Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Downloading postal codes.
- rake aborted!
- /app/app/models/postal_code.rb:13: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or 'n'
- when Integer: first(:conditions => { :code => code })
- ^
- /app/app/models/postal_code.rb:14: syntax error, unexpected keyword_when, expecting keyword_end
- when Hash: first(:conditions => {...
- ^
- /app/app/models/postal_code.rb:59: syntax error, unexpected keyword_end, expecting $end
- 11 def self.get(code)
- 12 case code
- 13 when Integer: first(:conditions => { :code => code })
- 14 when Hash: first(:conditions => { :city => code[:city], :state => code[:state] })
- 15 else raise InternalException.new("Invalid input.")
- 16 end
- 17 end
- 51 # now set min and max lat and long accordingly
- 52 area[:min_lat] = latitude - area[:lat_degrees]
- 53 area[:max_lat] = latitude + area[:lat_degrees]
- 54 area[:min_lon] = longitude - area[:lon_degrees]
- 55 area[:max_lon] = longitude + area[:lon_degrees]
- 56
- 57 area
- 58 end
- def self.get(code)
- case code
- when Integer then first(:conditions => { :code => code })
- when Hash then first(:conditions => { :city => code[:city], :state => code[:state] })
- else raise InternalException.new("Invalid input.")
- end
- end
- * Deprecated syntax
- o colon (:) instead of "then" in if/unless or case expression.
- case code
- when Integer then first(:conditions => { :code => code })
- when Hash then first(:conditions => { :city => code[:city], :state => code[:state] })
- else raise InternalException.new("Invalid input.")
- end
- case code
- when Integer
- first(:conditions => { :code => code })
- when Hash
- first(:conditions => { :city => code[:city], :state => code[:state] })
- else
- raise InternalException.new("Invalid input.")
- end
Add Comment
Please, Sign In to add comment