You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does a normal call (such as @record.settings(:some_configured_type)) work? Interested to see whether there's a general problem with the gem loading or whether it's specific to the default_settings hash.
I'm having a similar problem using 2.4.3. Here's an example:
shop=Shop.firstsettings=RailsSettings::SettingObject.find_by(target_id: shop.id,target_type: "Shop")# settings returns RailsSettings::SettingObject with all settings thats good# settings.discount also returns good datasettings.blank?# this gives error, also .present? etc
Error:
NoMethodError: undefinedmethod`default_settings' for #<Class:0x00007f9bc74aac58>Did you mean? default_extensionsfrom /Users/benjam1n/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/activerecord-5.2.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
It appears that the target class isn't being assigned a default_settings hash. Why might this be the case?
I've tried it on two different models in our codebase.
Using Rails 3.2.22 and Ruby 2.3.3
The text was updated successfully, but these errors were encountered: