Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
This commit is contained in:
parent
1413c23c50
commit
7754189187
257 changed files with 1449 additions and 1449 deletions
|
@ -3,22 +3,22 @@ class ActivityObserver < ActiveRecord::Observer
|
|||
|
||||
def after_create(record)
|
||||
Event.create(
|
||||
:project => record.project,
|
||||
:target_id => record.id,
|
||||
:target_type => record.class.name,
|
||||
:action => Event.determine_action(record),
|
||||
:author_id => record.author_id
|
||||
project: record.project,
|
||||
target_id: record.id,
|
||||
target_type: record.class.name,
|
||||
action: Event.determine_action(record),
|
||||
author_id: record.author_id
|
||||
)
|
||||
end
|
||||
|
||||
def after_save(record)
|
||||
if record.changed.include?("closed")
|
||||
Event.create(
|
||||
:project => record.project,
|
||||
:target_id => record.id,
|
||||
:target_type => record.class.name,
|
||||
:action => (record.closed ? Event::Closed : Event::Reopened),
|
||||
:author_id => record.author_id_of_changes
|
||||
project: record.project,
|
||||
target_id: record.id,
|
||||
target_type: record.class.name,
|
||||
action: (record.closed ? Event::Closed : Event::Reopened),
|
||||
author_id: record.author_id_of_changes
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue