Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No column "flaggings_count" #20

Open
MathieuRbrt opened this issue May 21, 2014 · 1 comment
Open

No column "flaggings_count" #20

MathieuRbrt opened this issue May 21, 2014 · 1 comment

Comments

@MathieuRbrt
Copy link

Good morning,
Whenever I try to make a user like a post (on the browser or console), it keeps showing me this error :

SQLite3::SQLException: no such column: flaggings_count: UPDATE "posts" SET "flaggings_count" = COALESCE("flaggings_count", 0) + 1 WHERE "posts"."id" = 67

Here's my like method :

def like
@post = Post.find(params[:id])
current_user.flag(@post, :like)
redirect_to posts_path, :notice => "You now like this post"
end

The migration looks ok, did it happen to anyone?
Thanks again for your gem!

@qtbon
Copy link

qtbon commented Jun 28, 2014

Ran into this issue as well. The last merge added the counter_cache option to the Flagging model's associations. So to use the latest version of this repo you have to manually add the flaggings_count column to your appropriate models. Or you can just use a version from a few commits back (at commit ref 4070).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants