Class: KirguduRefs::Globe::Country

Inherits:
BaseModel
  • Object
show all
Includes:
KirguduBase::Models::BasicProperties::CreatedBy, KirguduBase::Models::BasicProperties::Portal, KirguduBase::Models::BasicProperties::UpdatedBy, KirguduBase::Models::Scopes::WithName, KirguduBase::Models::Scopes::WithSlug, ModelBasicProperties::ContinentID, ModelBasicProperties::CountryID, ModelBasicProperties::CurrencyID, ModelBasicProperties::RegionID, ModelBasicProperties::StateID
Defined in:
app/models/kirgudu_refs/globe/country.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModelBasicProperties::CurrencyID

included

Methods included from ModelBasicProperties::ContinentID

included

Methods included from ModelBasicProperties::RegionID

included

Methods included from ModelBasicProperties::StateID

included

Methods included from ModelBasicProperties::CountryID

included

Class Method Details

.apply_filters_to_query(query, filters = {}) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'app/models/kirgudu_refs/globe/country.rb', line 65

def self.apply_filters_to_query(query, filters={})
  filters ||= {}

  query = query
  .with_area_min(filters[:area_min])
  .with_area_max(filters[:area_max])
  .with_population_min(filters[:population_min])
  .with_population_max(filters[:population_max])
  .by_currency(filters[:currency_id])
  .by_capital(filters[:capital_id])
  .by_continent(filters[:continent_id])
  .with_is_active(filters[:is_active])

  super(query, filters)
end

Instance Method Details

#capital_nameObject



81
82
83
# File 'app/models/kirgudu_refs/globe/country.rb', line 81

def capital_name
  capital.name if capital
end