Giter VIP home page Giter VIP logo

acts-as-rated's People

Contributors

brimil01 avatar jasherai avatar rsturim avatar wolfmanjm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

acts-as-rated's Issues

deprecation warning in rails 3.1

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

write_inheritable_attribute no longer found in rails 3.2.1

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:inacts_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

find_rated_by(user) returns error in Rails 3

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

Rails 3 compatibility

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.