Class: State

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/state.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_all_statesObject

Get All States



12
13
14
# File 'app/models/state.rb', line 12

def self.get_all_states
  State.pluck(:id, :state_code, :state_name).map{|id, code, name| {id: id, code: code, name: name}}
end

Instance Method Details

#nameObject

has_many :licenses, :class_name => “State”, :foreign_key => “id”



7
8
9
# File 'app/models/state.rb', line 7

def name
  state_name
end