-
Notifications
You must be signed in to change notification settings - Fork 25
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
Invalid query when running some class methods? #32
Comments
The table for photos:
|
@antonysastre for me everything works. The method I'm calling is
create_table "events", force: :cascade do |t|
# ...
t.string "tags", :default=>[], :null=>false, :array=>true
end |
Thanks @vfonic i actually misspelled the method call. I was calling I updated the issue. 🙂 Update: Getting the same error on |
I just went back to my project and realized I'm not using Perhaps that's why you're seeing the issue. Please double check the README and follow the steps from there from beginning. |
@vfonic Good catch! I updated to 0.6.0 and the new alias |
@vfonic What DB are you using? MySQL, PostreSQL or other? |
@antonysastre I remember seeing this issue in my codebase in the past, but don't remember how I've dealt with it. Would love to fix it as well. It would be really helpful, if you can reproduce this issue in a test. I've been successfully using temping gem ( https://github.com/jpignata/temping ) in the past to model database-backed AR relationship to test similar issues. |
@skatkov Great to know thanks, i'm working on recreating it in the tests. I can confirm that it has to do with the construction of the SQL query.
Doesn't work since the |
Running: PostgreSQL 11
> Photo.last.tags => ["coffee", "sun"]
> Photo.with_any_tags("coffee") => [#<Photo: …>, #<Photo: …>]
> Photo.tags_cloud => ActiveRecord::StatementInvalid: PG::UndefinedTable
Running
Photo.tags_cloud
or seems to produce invalid query:—
Update: Getting the same error on
Photo.all_tags
.Update: Updated to 0.6.0, same issue.
The text was updated successfully, but these errors were encountered: