Skip to content

Commit

Permalink
Merge pull request #225 from yui-knk/refactoring
Browse files Browse the repository at this point in the history
Using `aasm_skipping_validations` method
  • Loading branch information
alto committed Apr 22, 2015
2 parents f394bde + 24ca121 commit a8e10dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/aasm/persistence/active_record_persistence.rb
Expand Up @@ -187,7 +187,7 @@ def requires_new?
end

def aasm_validate_states
unless AASM::StateMachine[self.class].config.skip_validation_on_save
unless aasm_skipping_validations
if aasm.current_state && !aasm.states.include?(aasm.current_state)
self.errors.add(AASM::StateMachine[self.class].config.column , "is invalid")
end
Expand Down

0 comments on commit a8e10dc

Please sign in to comment.