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