mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
fix deprecation warnings in rails3 (_without_ breaking rails2)
This commit is contained in:
parent
0600de0410
commit
eced341dfa
1 changed files with 6 additions and 1 deletions
|
@ -50,7 +50,12 @@ module AASM
|
|||
end
|
||||
end
|
||||
end
|
||||
base.respond_to?(:before_validation_on_create) ? base.before_validation_on_create(:aasm_ensure_initial_state) : base.before_validation(:aasm_ensure_initial_state, :on => :create)
|
||||
|
||||
if ActiveRecord::VERSION::MAJOR >= 3
|
||||
base.before_validation(:aasm_ensure_initial_state, :on => :create)
|
||||
else
|
||||
base.before_validation_on_create(:aasm_ensure_initial_state)
|
||||
end
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
|
|
Loading…
Reference in a new issue