Class: Province

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/forge/app/models/province.rb

Class Method Summary collapse

Class Method Details

.options_for_select(options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/forge/app/models/province.rb', line 17

def self.options_for_select(options={})
  options[:add_blank] ||= false
  text_for_blank = options[:text_for_blank] || "All"
  provinces = Province.all.collect { |p| [p.title, p.id] }
  if options[:add_blank]
    provinces.unshift [text_for_blank, 0]
  end

  provinces
end