Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed Rails 3.1 Deprecation Warning:

DEPRECATION WARNING: Using & to merge relations has been deprecated and will be removed in Rails 3.1. Please use the relation's merge method, instead.
  • Loading branch information...
commit 702c65c1b1b06f7a40a3f732be843b08bf0037d6 1 parent d0838e9
Benji Orozco benoror authored

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 lib/metropoli/api/api.rb
8 lib/metropoli/api/api.rb
@@ -5,20 +5,20 @@ class Api < Sinatra::Base
5 5 include ConfigurationHelper
6 6
7 7 get '/cities.json' do
8   - @cities = city_class.autocomplete(params[:q])
9   - @cities &= city_class.limit(autocomplete_limit)
  8 + @cities = city_class.autocomplete(params[:q])
  9 + @cities = @cities.merge(city_class.limit(autocomplete_limit))
10 10 jsonify(@cities)
11 11 end
12 12
13 13 get '/states.json' do
14 14 @states = state_class.autocomplete(params[:q])
15   - @states &= state_class.limit(autocomplete_limit)
  15 + @states = @states.merge(state_class.limit(autocomplete_limit))
16 16 jsonify(@states)
17 17 end
18 18
19 19 get '/countries.json' do
20 20 @countries = country_class.autocomplete(params[:q])
21   - @countries &= country_class.limit(autocomplete_limit)
  21 + @countries = @countries.merge(country_class.limit(autocomplete_limit))
22 22 jsonify(@countries)
23 23 end
24 24

0 comments on commit 702c65c

Please sign in to comment.
Something went wrong with that request. Please try again.