Skip to content

Commit

Permalink
Merge 17ea618 into abd083f
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Jun 20, 2020
2 parents abd083f + 17ea618 commit 55a64f6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Expand Up @@ -43,6 +43,18 @@ jobs:
gemfile: gemfiles/rails_6.0.gemfile
- rvm: 2.4.10
gemfile: gemfiles/rails_edge.gemfile
- rvm: 2.7.1
gemfile: gemfiles/rails_5.0.gemfile
- rvm: 2.7.1
gemfile: gemfiles/rails_5.1.gemfile
- rvm: 2.7.1
gemfile: gemfiles/rails_5.2.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails_5.0.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails_5.1.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails_5.2.gemfile
fast_finish: true

script: bundle exec rake test:all
4 changes: 2 additions & 2 deletions lib/client_side_validations/action_view/form_helper.rb
Expand Up @@ -98,10 +98,10 @@ def construct_validators
def add_validator(validator_hash, validation_hash, name, attr)
if validation_hash.key?(attr)
validator_hash[name] = validation_hash[attr]
elsif attr.to_s.ends_with?('_id')
elsif attr.to_s.end_with?('_id')
association_name = attr.to_s.gsub(/_id\Z/, '').to_sym
add_validator_with_association validator_hash, validation_hash, name, association_name
elsif attr.to_s.ends_with?('_ids')
elsif attr.to_s.end_with?('_ids')
association_name = attr.to_s.gsub(/_ids\Z/, '').pluralize.to_sym
add_validator_with_association validator_hash, validation_hash, name, association_name
end
Expand Down
2 changes: 1 addition & 1 deletion lib/client_side_validations/active_model.rb
Expand Up @@ -91,7 +91,7 @@ def check_new_record(validator)
end

def will_save_change?(options)
options.is_a?(Symbol) && (options.to_s.ends_with?('changed?') || options.to_s.starts_with?('will_save_change_to'))
options.is_a?(Symbol) && (options.to_s.end_with?('changed?') || options.to_s.start_with?('will_save_change_to'))
end

def check_conditionals(attr, validator, force)
Expand Down

0 comments on commit 55a64f6

Please sign in to comment.