From fccd5e9e2fa94629a065fcc319a63ba7ee1ed641 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 16 Feb 2016 16:09:07 +0100 Subject: [PATCH] cleans up --- app/models/proposal.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/proposal.rb b/app/models/proposal.rb index b6106951d..2d681fa67 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -61,10 +61,8 @@ class Proposal < ActiveRecord::Base end def self.search_by_code(terms) - if code = self.match_code(terms) - results = where(id: code[1]) - end - + matched_code = self.match_code(terms) + results = where(id: matched_code[1]) if matched_code return results if (results.present? && results.first.code == terms) end