Alias ​​de alcance de Rails

class User < ActiveRecord::Base
  scope :with_zipcode, lambda { |zip| where(zipcode: zip) }
  singleton_class.send(:alias_method, :has_zipcode, :with_zipcode)
end
Dark Deer