X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3880ac5de8150eef3cc5b26eb9814f5c1d681afa..91dac23254c3674bee23cfd33fbedc2c4380924b:/app/controllers/user_preference_controller.rb diff --git a/app/controllers/user_preference_controller.rb b/app/controllers/user_preference_controller.rb index 059f00bbe..a3face30d 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,7 +69,7 @@ class UserPreferenceController < ApplicationController # update the value of a single preference def update_one begin - pref = UserPreference.find(@user.id, params[:preference_key]) + pref = UserPreference.find([@user.id, params[:preference_key]]) rescue ActiveRecord::RecordNotFound pref = UserPreference.new pref.user = @user @@ -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