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
【Question】When use colon(::) for class name. #4
Comments
Hi, thanks for posting. I added a patch to make gem 'attr_searchable', :git => 'https://github.com/mrkamel/attr_searchable.git' and check if the following is sufficient for you: class Account < ActiveRecord::Base
include AttrSearchable
attr_searchable :name
attr_searchable :setting => "account_settings.formal_name"
attr_searchable_alias :account_settings => :setting
has_one :setting
end |
Thanks for response.
I have make sure existense of "account_settings".
part of code. class Account < Common
include AttrSearchable
attr_searchable :name
attr_searchable :setting => "account_settings.formal_name"
attr_searchable_alias :account_settings => :setting
scope :search_scope, -> { }
has_one :setting, dependent: :destroy
end |
This error does not belong to the primary issue. An empty scope :search_scope, -> { eager_load :setting }
# OR
scope :search_scope, -> { joins :setting }
# OR arbitrary other definitions
# OR not use search_scope at all to let AttrSearchable auto-eagerload :setting |
Very Sorry..... I got it. I used scope
So, I tried empty search_scope. Anyway. very thanks. and sorry my English. |
Nothing to worry about. Moreover, it's already on my agenda to extend the auto-eagerloading to only eager load what is really neccessary (only the associations referenced within the query string), such that the warning will go away soon. |
It's pretty good! |
Hi there.
my setting is below..
models
Account
Setting
database tablename is "account_settings"
Directory structure is ...
I tried. but NameError happened.
uninitialized constant AccountSetting
How do I write to model setting?
The text was updated successfully, but these errors were encountered: