Module: KirguduRefs::ModelBasicProperties::CurrencyID

Included in:
Globe::Country
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



50
51
52
53
54
55
56
57
# File 'app/helpers/kirgudu_refs/model_basic_properties.rb', line 50

def self.included(base)
  base.belongs_to :currency, class_name: ::KirguduRefs::National::Currency, foreign_key: :currency_id
  base.scope :by_currency, lambda { |value| base.where(currency_id: value) if value }

  base.class_eval do
    include InstanceMethods
  end
end