slate-studio / activeadmin-settings

Settings backend for activeadmin based projects - pretty handy tool.
88 stars 65 forks source link

undefined method `find_or_create_by_name_and_locale' #28

Open joeswann opened 10 years ago

joeswann commented 10 years ago

I installed the latest master (for Rails 4) and everything seems to be fine up until using settings_value in either the view or the controller.

I think this may be a deprecated function http://stackoverflow.com/questions/3046607/rails-find-or-create-by-more-than-one-attribute

joeswann commented 10 years ago

replacing find_or_create_by_name_and_locale(name, (locale || I18n.locale)).value

with self.where(:name => name, :locale => (locale || I18n.locale)).first_or_initialize

Seems to do the trick

yurgon commented 9 years ago

same problem on Rails 4.1.5