-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Make alias to attributes #39
Comments
Dear Author, can you give some feedback for the above question? We all need it. thank you. |
Check out the full_name ransacker from the demo app |
Thank you for you help! I have a deeper question. class Article < ActiveRecord::Base
#has attributes: title, :description
has_many :comments
end
class Comment < ActiveRecord::Base
#has attributes :title, :description
belongs_to :article
end Now I hope to simply, keyword_cont I want to find the keyword inside the article's title and description as well as related comment's title and description. ransacker :keyword, formatter: proc{|v| v}, splat_param: true do |parent|
Arel::Nodes::InfixOperation.new('||', parent.table[:title], parent.table[:description])
end Now my questions is how to deal with OUTER JOIN with comments and search title and description on comments in ransacker definition? |
Drawing right from the example I linked to earlier, check out this SO post. |
I am interested in making alias to set of attributes, e.g. instead of writing:
it would be great to have ability to write simply:
when somewhere we defines that full_name consists of first_name and last_name
The text was updated successfully, but these errors were encountered: