Permalink
Browse files

On second thoughts, use method_symbol instead of method

  • Loading branch information...
1 parent 443f2d4 commit 8912298ff68fba274b067f742cd61f956fc19125 @jamesu jamesu committed Sep 24, 2010
@@ -68,7 +68,7 @@ def reload_owner
def user_track
if not @logged_user.nil?
- store_location if request.method == :get and request.format == :html
+ store_location if request.method_symbol == :get and request.format == :html
User.update(@logged_user.id, {:last_visit => Time.now.utc})
end
true
@@ -285,15 +285,15 @@ def share
set_public = page_attribs.has_key?(:is_public) and page_attribs[:is_public] == 'true'
- case request.method
- when 'GET'
- when 'POST'
+ case request.method_symbol
+ when :get
+ when :post
# Set afresh
unless set_users.nil?
guest_users = @page.shared_users.collect { |user| user.account_id.nil? ? user : nil }.compact
@page.shared_users = guest_users + set_users.collect(&grab_users).compact
end
- when 'PUT'
+ when :put
# Insert into list
unless set_users.nil?
set_users.collect(&grab_users).compact.each {|user| @page.shared_users << user unless @page.shared_users_ids.include?(user.id)}
@@ -306,11 +306,11 @@ def share
end
# Merge in emails
- unless request.method == :get
+ unless request.method_symbol == :get
@page.updated_by = @logged_user
@page.is_public = set_public
@page.shared_emails = page_attribs[:shared_emails]
- @page.save unless request.method == :get
+ @page.save unless request.method_symbol == :get
end
respond_to do |format|
@@ -366,10 +366,10 @@ def tags
@page = Page.find(params[:id])
return error_status(true, :cannot_edit_page) unless (@page.can_be_edited_by(@logged_user))
- case request.method
- when 'GET'
+ case request.method_symbol
+ when :get
@view = 'tags_form'
- when 'POST'
+ when :post
@page.tags = params[:page][:tags]
@view = 'tags'
@page.save
@@ -168,8 +168,8 @@ def current
# GET /users/forgot_password
def forgot_password
- case request.method
- when 'POST'
+ case request.method_symbol == :get
+ when :post
@your_email = params[:your_email]
user = User.find(:first, :conditions => ['email = ? AND account_id NOT NULL', @your_email])
@@ -202,8 +202,8 @@ def reset_password
@initial_signup = params.has_key? :initial
- case request.method
- when 'POST'
+ case request.method_symbol == :get
+ when :post
@password_data = params[:user]
@@ -64,7 +64,7 @@ def login_required
def access_denied
respond_to do |format|
format.html do
- store_location if request.method == :get
+ store_location if request.method_symbol == :get
if @token_login.nil?
redirect_to '/login'
else

0 comments on commit 8912298

Please sign in to comment.