Class: City
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- City
- Defined in:
- app/models/city.rb
Instance Method Summary collapse
Instance Method Details
#short_name ⇒ Object
9 10 11 |
# File 'app/models/city.rb', line 9 def short_name @short_name ||= name.gsub(/市|自治州|地区|特别行政区/, '') end |
#siblings ⇒ Object
13 14 15 |
# File 'app/models/city.rb', line 13 def siblings @siblings ||= where(nil).for_province(province_id) end |