2015-04-26 12:48:37 +05:30
|
|
|
module Notes
|
|
|
|
class UpdateService < BaseService
|
2015-09-11 14:41:01 +05:30
|
|
|
def execute(note)
|
|
|
|
return note unless note.editable?
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
note.update_attributes(params.merge(updated_by: current_user))
|
2015-11-26 14:37:03 +05:30
|
|
|
note.create_new_cross_references!(current_user)
|
2015-09-11 14:41:01 +05:30
|
|
|
note.reset_events_cache
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
note
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|