jasherai / acts-as-rated Goto Github PK
View Code? Open in Web Editor NEWgit svn clone of acts-as-rated
Home Page: http://acts-as-rated.rubyforge.org
License: MIT License
git svn clone of acts-as-rated
Home Page: http://acts-as-rated.rubyforge.org
License: MIT License
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from acts_as_rated at /.../vendor/plugins/acts_as_rated/lib/acts_as_rated.rb:121)
Not quite sure how to fix this
undefined method `write_inheritable_attribute' for #Class:0xb3546574
activerecord (3.2.1) lib/active_record/dynamic_matchers.rb:50:in method_missing' vendor/plugins/acts_as_rated/lib/acts_as_rated.rb:116:in
acts_as_rated'
app/models/input.rb:5
Rewriting those two lines (116) as
class_attribute :acts_as_rated_options
self.acts_as_rated_options=
{ :rating_range => options[:rating_range],
:rating_class => rating_class,
:stats_class => stats_class,
:rater_class => rater_class }
Seems to fix it
I'm getting the following error:
irb(main):009:0> Article.find_rated_by(User.first)
NoMethodError: undefined method `class_name_of_active_record_descendant' for ActiveRecord::Base:Class
from C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/base.rb:1016:in `method_missing'
from C:/Users/rob/web/insite-rails-cms/vendor/plugins/jasherai-acts-as-rated/lib/acts_as_rated.rb:376:in `send'
from C:/Users/rob/web/insite-rails-cms/vendor/plugins/jasherai-acts-as-rated/lib/acts_as_rated.rb:376:in `find_rated_by'
from (irb):9
I can fix the error by changing line 376 in acts_as_rated.rb from:
rated_class = ActiveRecord::Base.send(:class_name_of_active_record_descendant, self).to_s
to:
rated_class = ActiveRecord::Base.send(:class_of_active_record_descendant, self).to_s
It uses class_name in two places which is no longer available in ActiveRecord, however simply replacing class_name with base_class fixes it and it works fine under Rails3. Will issue a pull request for the fix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.