Class: City

Inherits:
ApplicationRecord show all
Defined in:
app/models/city.rb

Overview

== Schema Information

Table name: cities
Database name: primary

id :integer not null, primary key
city_name :string(80)
city_type :string(1)
code :string(10) not null

Constant Summary

Constants included from Models::Schedulable

Models::Schedulable::SIMPLE_FORM_OPTIONS

Belongs to collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Instance Method Details

#postal_codePostalCode?

Returns the postal code this city name belongs to.

Returns:

  • (PostalCode, nil)

    the postal code this city name belongs to



14
# File 'app/models/city.rb', line 14

belongs_to :postal_code, primary_key: :code, foreign_key: :code, optional: true