Merge pull request #209 from facetostool/feature
change method to check attribute_name
This commit is contained in:
commit
123700ce4e
|
@ -166,7 +166,7 @@ module AASM
|
|||
def aasm_ensure_initial_state
|
||||
# checking via respond_to? does not work in Rails <= 3
|
||||
# if respond_to?(self.class.aasm.attribute_name) && send(self.class.aasm.attribute_name).blank? # Rails 4
|
||||
if attributes.key?(self.class.aasm.attribute_name.to_s) && send(self.class.aasm.attribute_name).blank?
|
||||
if attribute_names.include?(self.class.aasm.attribute_name.to_s) && send(self.class.aasm.attribute_name).blank?
|
||||
aasm.enter_initial_state
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue