Class: SimpleAddress::Region
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- SimpleAddress::Region
- Defined in:
- app/models/simple_address/region.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.search(params) ⇒ Object
7 8 9 10 11 |
# File 'app/models/simple_address/region.rb', line 7 def self.search(params) where(country_id: params[:country_id]).where( 'name LIKE ?', "#{params[:name]}%" ) end |
Instance Method Details
#country_name ⇒ Object
13 14 15 |
# File 'app/models/simple_address/region.rb', line 13 def country_name country.name if country end |