Module: KirguduRefs::ModelBasicProperties::LanguageID

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



25
26
27
28
29
30
31
32
# File 'app/helpers/kirgudu_refs/model_basic_properties.rb', line 25

def self.included(base)
  base.belongs_to :language, class_name: ::KirguduRefs::National::Language, foreign_key: :language_id
  base.scope :by_language, lambda { |value| base.where(language_id: value) if value }

  base.class_eval do
    include InstanceMethods
  end
end