Skip to content
Browse files

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...
1 parent d0838e9 commit 702c65c1b1b06f7a40a3f732be843b08bf0037d6 @benoror benoror committed Jun 1, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/metropoli/api/api.rb
View
8 lib/metropoli/api/api.rb
@@ -5,20 +5,20 @@ class Api < Sinatra::Base
include ConfigurationHelper
get '/cities.json' do
- @cities = city_class.autocomplete(params[:q])
- @cities &= city_class.limit(autocomplete_limit)
+ @cities = city_class.autocomplete(params[:q])
+ @cities = @cities.merge(city_class.limit(autocomplete_limit))
jsonify(@cities)
end
get '/states.json' do
@states = state_class.autocomplete(params[:q])
- @states &= state_class.limit(autocomplete_limit)
+ @states = @states.merge(state_class.limit(autocomplete_limit))
jsonify(@states)
end
get '/countries.json' do
@countries = country_class.autocomplete(params[:q])
- @countries &= country_class.limit(autocomplete_limit)
+ @countries = @countries.merge(country_class.limit(autocomplete_limit))
jsonify(@countries)
end

0 comments on commit 702c65c

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