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