2014-09-02 15:12:13 +00:00
|
|
|
module Notes
|
|
|
|
class UpdateService < BaseService
|
2015-07-30 12:45:54 +00:00
|
|
|
def execute(note)
|
|
|
|
return note unless note.editable?
|
2014-09-02 15:12:13 +00:00
|
|
|
|
2015-07-30 12:45:54 +00:00
|
|
|
note.update_attributes(params.merge(updated_by: current_user))
|
2014-09-02 15:12:13 +00:00
|
|
|
|
2015-07-31 12:29:18 +00:00
|
|
|
note.reset_events_cache
|
2014-09-02 15:12:13 +00:00
|
|
|
|
|
|
|
note
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|