Skip to content

Instantly share code, notes, and snippets.

@markmcdonald51
Created April 23, 2010 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markmcdonald51/376890 to your computer and use it in GitHub Desktop.
Save markmcdonald51/376890 to your computer and use it in GitHub Desktop.
module AasmAddons
def self.included(base_class)
base_class.class_eval do
def aasm_fire_event(*args)
line_items.each do |li|
#li.send("#{args.first.to_s}!")
li.update_attributes(:state => args.first.to_s)
end
state_logs.create!(:state => args.first.to_s, :user => current_user)
super(*args)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment