activerecord-reputation-system icon indicating copy to clipboard operation
activerecord-reputation-system copied to clipboard

Action before or after evaluation

Open ghost opened this issue 13 years ago • 4 comments

Hi ! I'm using this gem, thank you ! Is it possible to do any action automatically before or after evaluation ? Like before_save or after_validation for an ActiveRecord.

Thank you

ghost avatar Dec 08 '12 16:12 ghost

Hi @vpoulain,

That's interesting idea!

What's the use cases you are thinking of?

kn avatar Dec 08 '12 17:12 kn

In my case, when my Item's evaluation reach a certain score, I have to modify an attribute of my Item. So, currently I check the new evaluation in my controller after update evaluation. But I'd prefer put this behavior into a model, why not by using after_evaluation. You see what I mean ?

ghost avatar Dec 08 '12 17:12 ghost

That makes sense.

Right now, such use case is not supported yet.

I'll work on it if I get a chance or you are more than welcome to give it a try :)

kn avatar Dec 08 '12 18:12 kn

Yeah, I can give a try after the Christmas break ;)

ghost avatar Dec 18 '12 13:12 ghost