I've installed the ActiveRecord
Reputation System on my app. How would I go about overriding or adding a callback/method to Evaluation model?
In general how do you add to any model for a gem you installed?
Simply reopen the class:
module ReputationSystem
class Evaluation < ActiveRecord::Base
def my_method_here
puts "Yey!"
end
end
end
You can put this file in config/initializers/my_monkey_patch.rb
or in lib/my_monkey_patch.rb
, but the later must be loaded into your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With