debian-mirror-gitlab/app/services/notes/update_service.rb

14 lines
242 B
Ruby
Raw Normal View History

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-04-26 12:48:37 +05:30
2015-09-11 14:41:01 +05:30
note.reset_events_cache
2015-04-26 12:48:37 +05:30
note
end
end
end