wbotelhos / rating

:star: A true Bayesian rating system with scope and cache enabled
https://wbotelhos.com
MIT License
72 stars 20 forks source link

Is there a way to change callback method name? #4

Closed fraz017 closed 2 years ago

fraz017 commented 4 years ago

Hi your gem is awesome. But i am having a problem (not with your gem). Is there a way to change the callback name rating to something else like ratings or anything else. Coz i already have columns named ratings so every time i try to run rate something i get ActiveRecord::DangerousAttributeError - rating is defined by Active Record. Check to make sure that you don't have an attribute or method with the same name. i have a legacy system it would be really a big pain to change column name. Looking forward

wbotelhos commented 4 years ago

When i created this gem a had the same problem and just on the final of the year that i could migrate all the application. I need to point the code to a old table, so i created the function to change the table name.

I know its hard to change a legacy system, but the method name represents the gem's name and to use other name is not so cool. I don't know how to dynamic create the method inside the gem and all the things still works, but if you know, i here to hear. I'm sorry for that. :(