Skip to content

Commit

Permalink
sanitize user.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
burningTyger committed Mar 29, 2011
1 parent 80faec9 commit 023524e
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ def facebook

def has_authorization?(auth)
a = Authorization.first(:provider => auth.to_s, :user_id => self.id)
if a.nil?
return false
else
return true
end
#return false if not authenticated and true otherwise.
!a.nil?
end

def get_authorization(auth)
Expand Down Expand Up @@ -125,7 +122,7 @@ def following? feed_url
f = Feed.first(:id => feed_id)
end

if f == nil
if f.nil?
false
else
following.include? f
Expand All @@ -134,18 +131,18 @@ def following? feed_url

timestamps!

def timeline(opts)
def timeline(params)
popts = {
:page => opts[:page],
:per_page => opts[:per_page]
:page => params[:page],
:per_page => params[:per_page]
}
Update.where(:author_id => following.map(&:author_id)).order(['created_at', 'descending']).paginate(popts)
end

def at_replies(opts)
def at_replies(params)
popts = {
:page => opts[:page],
:per_page => opts[:per_page]
:page => params[:page],
:per_page => params[:per_page]
}
Update.where(:text => /^@#{username}\b/).order(['created_at', 'descending']).paginate(popts)
end
Expand All @@ -166,7 +163,7 @@ def password=(pass)
def set_password_reset_token
self.password_reset_sent = DateTime.now
set_perishable_token
return self.perishable_token
self.perishable_token
end

# Set a new password, clear the date the password reset token was sent and
Expand Down

0 comments on commit 023524e

Please sign in to comment.