Module: KirguduRefs::ModelBasicProperties::CapitalID
- Included in:
- Globe::Region, Globe::State
- Defined in:
- app/helpers/kirgudu_refs/model_basic_properties.rb
Defined Under Namespace
Modules: InstanceMethods
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
157 158 159 160 161 162 163 164 |
# File 'app/helpers/kirgudu_refs/model_basic_properties.rb', line 157 def self.included(base) base.belongs_to :capital, class_name: ::KirguduRefs::Globe::City, foreign_key: :capital_id base.scope :by_capital, lambda { |value| base.where(capital_id: value) if value } base.class_eval do include InstanceMethods end end |