FEATURE: Group logs.

This commit is contained in:
Guo Xiang Tan
2016-12-11 23:36:15 +08:00
parent 790f1ef9f3
commit 05f55dbc10
37 changed files with 857 additions and 45 deletions

View File

@@ -9,6 +9,7 @@ class Group < ActiveRecord::Base
has_many :categories, through: :category_groups
has_many :users, through: :group_users
has_many :group_histories, dependent: :destroy
has_and_belongs_to_many :web_hooks
@@ -347,7 +348,8 @@ class Group < ActiveRecord::Base
end
def add(user)
self.users.push(user)
self.users.push(user) unless self.users.include?(user)
self
end
def remove(user)