lib/user_preferences/api.rb in user_preferences-0.0.2 vs lib/user_preferences/api.rb in user_preferences-0.0.3

- old
+ new

@@ -35,11 +35,11 @@ def default_preferences @_category_defaults ||= UserPreferences.defaults(@category) end def saved_preferences - @_saved_preferences ||= @scope.select([:id, :category, :name, :value, :user_id]).all + @_saved_preferences ||= @scope.select([:id, :category, :name, :value, :user_id]) end def find_or_init_preference(name) unless preference = saved_preferences.detect { |p| p.name == name } preference = @scope.find_by_name(name) || @scope.build(name: name, category: @category) @@ -58,6 +58,6 @@ end result end end end -end \ No newline at end of file +end