I have a problem where I have 2 associated models which are stored in separate databases on the same server.
Say I have two models, City and SportsTeam. I want to be able to find all the sports teams which are nfl teams, and then get their associated cities. I have run into a lot of trouble trying to do this since they are located on separate dbs.
class City
eastablish_connection :city_db
has_one :sports_team
end
class SportsTeam
belongs_to :city
validates :is_nfl_team, :is_mlb_team, :is_nhl_team, presence: true
end