We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using rails with activeadmin, I want to be able to filter using all translations:
rails
activeadmin
filter :translations_title_i_cont, as: :string, label: 'Title Search'
To make it work I've had to make a bit of magic in application_record.rb:
application_record.rb
class ApplicationRecord < ActiveRecord::Base extend Mobility self.abstract_class = true class << self alias mobility_translates translates def translates(*attributes, **options) mobility_translates(*attributes, **options) translation_class = const_get(:Translation) translation_class.define_singleton_method(:ransackable_attributes) do |_arg = nil| attributes.map(&:to_s) end translation_class.define_singleton_method(:ransackable_associations) do |_arg = nil| [] end end end end
Would it be possible for this gem to define those two methods automatically?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm using
rails
withactiveadmin
, I want to be able to filter using all translations:To make it work I've had to make a bit of magic in
application_record.rb
:Would it be possible for this gem to define those two methods automatically?
The text was updated successfully, but these errors were encountered: