edgarjs / ajaxful-rating

Provides a simple way to add rating functionality to your application.
http://rdoc.info/projects/edgarjs/ajaxful-rating
418 stars 127 forks source link

failed to set max stars with dimension #92

Open arthurccube opened 11 years ago

arthurccube commented 11 years ago

Hi,

I tried to set the max star to 100 but it fails. I suspect its due to the using of dimensions together: ajaxful_rateable :stars => 100, :dimensions => [:grade, :overall]

Max star is always 5 no matter how I change the value

as in my another model, the :stars can be changed from the following: ajaxful_rateable :stars => 10, :cache_column => :rating_average

arthurccube commented 11 years ago

Guys, I found the :dimensions makes max_stars failed. I printed the "self.ajaxful_rating_options", the ":stars" keeps to be 5 with the "dimensions",

but without "dimensions", "stars" can change to 10.

And my workaround is called the update myself! (hopefully, there is some fix for it):

ajaxful_rateable :stars => 10, :dimensions => [:grade, :overall] self.ajaxful_rating_options.update({:stars => 10, :dimensions => [:grade, :overall]})