Skip to content

Commit

Permalink
Merge pull request #13576 from opf/fix/remove_superfluous_validation_…
Browse files Browse the repository at this point in the history
…methods

remove overrides doing the same as super()
  • Loading branch information
ulferts authored Aug 31, 2023
2 parents c8c490f + f5bdb71 commit aaf3d42
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions app/contracts/base_contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,13 @@ def writable?(attribute)
writable_attributes.include?(attribute.to_s)
end

def valid?(*_args)
super()

errors.empty?
end

# Provide same interface with valid? and validate
# as with AM::Validations
#
# Do not use alias_method as this will not work when
# valid? is overridden in subclasses
def validate(*args)
valid?(*args)
def validate(*)
valid?(*)
end

# Methods required to get ActiveModel error messages working
Expand Down

0 comments on commit aaf3d42

Please sign in to comment.