2012-11-19 19:24:05 +01:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: groups
|
|
|
|
#
|
|
|
|
# id :integer not null, primary key
|
|
|
|
# name :string(255) not null
|
|
|
|
# code :string(255) not null
|
|
|
|
# owner_id :integer not null
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
#
|
|
|
|
|
2012-11-22 19:34:16 +01:00
|
|
|
class Group < Namespace
|
2012-10-03 13:26:37 +02:00
|
|
|
def users
|
2012-10-09 02:10:04 +02:00
|
|
|
User.joins(:users_projects).where(users_projects: {project_id: project_ids}).uniq
|
2012-10-03 13:26:37 +02:00
|
|
|
end
|
2012-11-23 05:11:09 +01:00
|
|
|
|
|
|
|
def human_name
|
|
|
|
name
|
|
|
|
end
|
2012-10-02 17:17:12 +02:00
|
|
|
end
|