Try replacing the redundant bits one at a time. For instance:
Ad.unverified_ads.size == 0
is equivalent to
Ad.unverified_ads.blank?
And you're repeating "if...else" a lot with just one line in each, so
turn it into a ternary:
if Ad.unverified_ads.size == 0
redirect_to verifications_path
else
redirect_to fast_verify_info_verification_path(Ad.unverified_ads.last)
end
becomes
redirect_to (Ad.unverified_ads.blank? ? verifications_path :
fast_verify_info_verification_path(Ad.unverified_ads.last))
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.