Giter Club home page Giter Club logo

Comments (5)

ouabing avatar ouabing commented on June 27, 2024 3

Same issue here.

A temporary workaround will be explicitly defining a method in your acts_as_votable model:

acts_as_votable

def acts_as_votable_options
  @acts_as_votable_options ||= { cacheable_strategy: :update_attributes }
end

from acts_as_votable.

fuuman avatar fuuman commented on June 27, 2024 2

Same problem here. Whenever i want to down or upvote, I get the exact same error message. Nothing is votable anymore.

Rails: 5.2.3
Version: 0.12.1

from acts_as_votable.

marcodetoni avatar marcodetoni commented on June 27, 2024 2

Does anyone have an app that can reproduce this issue? That would be helpful here!

Don't have a project to share but the issue is reproducible: the problem seems related to models that implement a single table inheritance, when acts_as_votable is set only on father object.

A workaround working for me is adding acts_as_votable even on child model.

from acts_as_votable.

ryanto avatar ryanto commented on June 27, 2024

Does anyone have an app that can reproduce this issue? That would be helpful here!

from acts_as_votable.

moseedat avatar moseedat commented on June 27, 2024

Does anyone have an app that can reproduce this issue? That would be helpful here!

Don't have a project to share but the issue is reproducible: the problem seems related to models that implement a single table inheritance, when acts_as_votable is set only on father object.

A workaround working for me is adding acts_as_votable even on child model.

100%

Had exactly the same issue. Had STI table (Parent class is called Post, child classes were Article, Link etc). Child classes inherit from Parent class.

Had to manually add

acts_as_votable cacheable_strategy: :update_columns

to child classes:

class Posts::Link < Post
  acts_as_votable cacheable_strategy: :update_columns
end

And to the parent class.

from acts_as_votable.

Related Issues (20)

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.