Skip to content

Commit

Permalink
Fix postcode_to_postcode_id.
Browse files Browse the repository at this point in the history
  • Loading branch information
studiospring committed Oct 6, 2015
1 parent 6346882 commit 0e48023
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/pv_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def pvo_search_params

# Change postcode param to postcode_id.
def postcode_to_postcode_id
postcode.id = 1234 if Rails.env == 'production'
self.postcode_id = 1234 if Rails.env == 'production'

pcode = Postcode.where('pcode = ?', self.postcode_id).select('id').first

pcode = Postcode.where('pcode = ?', postcode.id).select('id').first
# Without this, rspec fails.
self.postcode_id = pcode.id unless pcode.nil?
end

Expand Down

0 comments on commit 0e48023

Please sign in to comment.