X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c8fb5ad24c5751bd2d43b86e4359381d200af066..34e3e51456774127d43408b7ab65c24f41373f62:/app/controllers/user_preference_controller.rb diff --git a/app/controllers/user_preference_controller.rb b/app/controllers/user_preference_controller.rb index 059f00bbe..7d6fc8e23 100644 --- a/app/controllers/user_preference_controller.rb +++ b/app/controllers/user_preference_controller.rb @@ -26,7 +26,7 @@ class UserPreferenceController < ApplicationController ## # return the value for a single preference def read_one - pref = UserPreference.find(@user.id, params[:preference_key]) + pref = UserPreference.find([@user.id, params[:preference_key]]) render :text => pref.v.to_s, :content_type => "text/plain" end @@ -69,8 +69,8 @@ class UserPreferenceController < ApplicationController # update the value of a single preference def update_one begin - pref = UserPreference.find(@user.id, params[:preference_key]) - rescue ActiveRecord::RecordNotFound + pref = UserPreference.find([@user.id, params[:preference_key]]) + rescue ActiveRecord::RecordNotFound pref = UserPreference.new pref.user = @user pref.k = params[:preference_key] @@ -85,7 +85,7 @@ class UserPreferenceController < ApplicationController ## # delete a single preference def delete_one - UserPreference.find(@user.id, params[:preference_key]).delete + UserPreference.find([@user.id, params[:preference_key]]).delete render :text => "", :content_type => "text/plain" end