-
-
Save nanosplit/b50241d66947fbcae3a1020d1f94ab8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Agent < ActiveRecord::Base | |
has_many :ar_listed, class_name: 'Abor::AborRetsResi', primary_key: 'agent_id', foreign_key: 'list_agent_mlsid' | |
end | |
#this lets me do: | |
@agent_listed_properties = current_agent.ar_listed | |
#which returns all the listed properties that agent has! Before, I would have had to do something like: | |
@agent_listed_properties = Abor::AborRetsResi.where(list_agent_mlsid: current_agent.agent_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment