You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cory Boyd edited this page May 23, 2014
·
2 revisions
Hey Cory, can you add this Tracker to a Team?
Yeah!
HOW DOES WORK???!
Like this!
tracker=Tracker.find(47)# Bountysource.comteam=Team.find_by(slug: 'bountysource')# Bountysource, duh# 1. Add the Tracker to the team. This relationship means "This is a Tracker that we use"team.add_tracker(tracker)# => #<TeamTrackerRelation id: 374, ... ># 2. Set the Tracker owner to the Team. This means "This is a Tracker that we own"tracker.update_attribute(:owner,team)# => true