ref: master
plugins/teams/models/teams_plugin/team_folder.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
class TeamsPlugin::TeamFolder < Folder attr_accessible :team has_many :team_works, as: :work, class_name: 'TeamsPlugin::Work' has_one :team_work, as: :work, class_name: 'TeamsPlugin::Work' has_one :team, through: :team_work, class_name: 'TeamsPlugin::Team', autosave: true validates_presence_of :team def name self.team.profiles.map(&:name).join(', ') end end |