Class: KirguduRefs::Globe::State

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::CapitalID, ModelBasicProperties::CountryID
Defined in:
app/models/kirgudu_refs/globe/state.rb

Class Method Summary collapse

Methods included from ModelBasicProperties::CapitalID

included

Methods included from ModelBasicProperties::CountryID

included

Class Method Details

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'app/models/kirgudu_refs/globe/state.rb', line 59

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_country(filters[:country_id])
  .by_capital(filters[:capital_id])
  .with_car_code(filters[:car_code])
  .with_is_active(filters[:is_active])

  super(query, filters)
end