change method to check attribute_name
This commit is contained in:
parent
f033ce0c2a
commit
ce241fc105
|
@ -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