-
-
Notifications
You must be signed in to change notification settings - Fork 828
Closed
Description
Comment.joins(:person).ransack(article_title_cont: 'aven',s: 'person_salary desc').result
The above code doesn't work and raise the following exception
ActiveRecord::StatementInvalid:
SQLite3::SQLException: no such column: people_comments.salary: SELECT "comments".* FROM "comments" INNER JOIN "people" ON "people"."id" = "comments"."person_id" LEFT OUTER JOIN "articles" ON "articles"."id" = "comments"."article_id" AND ('default_scope' = 'default_scope') WHERE ("articles"."title" LIKE '%aven%') ORDER BY "people_comments"."salary" DESC
Alternate which works are as follow
Comment.ransack(article_title_cont: 'aven',s: 'person_salary desc').result
Comment.joins(:person).ransack(s: 'person_salary desc', article_title_cont: 'aven').result
Metadata
Metadata
Assignees
Labels
No labels