Class: District
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- District
- Defined in:
- app/models/district.rb
Instance Method Summary collapse
Instance Method Details
#province ⇒ Object
8 9 10 |
# File 'app/models/district.rb', line 8 def province city.province end |
#short_name ⇒ Object
12 13 14 |
# File 'app/models/district.rb', line 12 def short_name @short_name ||= name.gsub(/区|县|市|自治县/, '') end |
#siblings ⇒ Object
16 17 18 |
# File 'app/models/district.rb', line 16 def siblings @siblings ||= where(nil).for_city(city_id) end |