mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-23 01:45:24 -05:00
Merge pull request #1118 from Br3nda/bw/assignment-in-condition
Don't use assignments in conditions
This commit is contained in:
@@ -26,12 +26,6 @@ Lint/AmbiguousRegexpLiteral:
|
||||
- 'spec/views/members/show.rss.haml_spec.rb'
|
||||
- 'spec/views/posts/show.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: AllowSafeAssignment.
|
||||
Lint/AssignmentInCondition:
|
||||
Exclude:
|
||||
- 'app/models/member.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Lint/HandleExceptions:
|
||||
Exclude:
|
||||
|
||||
@@ -91,11 +91,9 @@ class Member < ActiveRecord::Base
|
||||
# allow login via either login_name or email address
|
||||
def self.find_first_by_auth_conditions(warden_conditions)
|
||||
conditions = warden_conditions.dup
|
||||
if login = conditions.delete(:login)
|
||||
where(conditions).login_name_or_email(login).first
|
||||
else
|
||||
find_by(conditions)
|
||||
end
|
||||
login = conditions.delete(:login)
|
||||
return where(conditions).login_name_or_email(login).first if login
|
||||
find_by(conditions)
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
||||
Reference in New Issue
Block a user