Class: Artisan::Activity::ProjectAuditor

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/activity/project_auditor.rb

Class Method Summary collapse

Class Method Details

.create_change(attrs) ⇒ Object



21
22
23
# File 'lib/artisan/activity/project_auditor.rb', line 21

def self.create_change(attrs)
  Repository.change.create_project_change(attrs)
end

.created(project_id, user_id, new_attributes) ⇒ Object



5
6
7
8
# File 'lib/artisan/activity/project_auditor.rb', line 5

def self.created( project_id, user_id, new_attributes)
  create_change(:source_id => project_id, :project_id => project_id,  :user_id => user_id, :event => :create,
                      :changed_fields => new_attributes)
end

.deleted(project_id, user_id) ⇒ Object



15
16
17
18
# File 'lib/artisan/activity/project_auditor.rb', line 15

def self.deleted(project_id, user_id)
  create_change(:source_id => project_id, :project_id => project_id,  :user_id => user_id, :event => :delete,
                      :changed_fields => {}, :original_fields => {})
end

.updated(project_id, user_id, original_attributes, new_attributes) ⇒ Object



10
11
12
13
# File 'lib/artisan/activity/project_auditor.rb', line 10

def self.updated(project_id, user_id, original_attributes, new_attributes)
  create_change(:source_id => project_id, :project_id => project_id,  :user_id => user_id, :event => :update,
                      :changed_fields => new_attributes, :original_fields => original_attributes)
end