Skip to content

Instantly share code, notes, and snippets.

@roy
Forked from DriesS/order_fianet.rb
Created October 16, 2012 08:55
Show Gist options
  • Save roy/3898145 to your computer and use it in GitHub Desktop.
Save roy/3898145 to your computer and use it in GitHub Desktop.
Class eval
module Order::FianetScore
extend ActiveSupport::Concern
included do
include FianetScore
after_save :submit_to_fianet_score_if_state_changed
end
def submit_to_fianet_score_if_state_changed
if self.fianet_eval && self.fianet_eval.changed? && self.fianet_eval == 100
self.submit_to_fianet_score
end
end
end
class Order
include Order::FianetScore
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment