Class: StatisticsByZip

Inherits:
ApplicationRecord show all
Defined in:
app/models/statistics_by_zip.rb

Overview

== Schema Information

Table name: statistics_by_zips
Database name: primary

id :integer not null, primary key
county_name :string(255)
households :integer
median_income :integer
zip :string(255)
created_at :datetime
updated_at :datetime

Indexes

index_statistics_by_zips_on_county_name (county_name)

Class Method Summary collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.select_options_county_name(scope_obj = nil) ⇒ Object



20
21
22
23
# File 'app/models/statistics_by_zip.rb', line 20

def self.select_options_county_name(scope_obj=nil)
  scope_obj ||= StatisticsByZip.all
  scope_obj.order(:county_name).to_a.map{|c| [c.county_name.to_s,c.county_name.to_s]}.uniq
end