Class: AgentZipCode

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_agent_zipcodes(agent) ⇒ Object

Get Agent’s zipcodes



9
10
11
# File 'app/models/agent_zip_code.rb', line 9

def self.get_agent_zipcodes(agent)
  AgentZipCode.where(agent_id: agent.id).pluck(:zip_code).map{|code| {zip_code: code}}
end

Instance Method Details

#describe_idObject



13
14
15
# File 'app/models/agent_zip_code.rb', line 13

def describe_id
	"AgentZipCode ##{id}"
end