Sha256: 21b19cb3ee43c49fc97240495e0b0ddbb7c7080cebe612ea9b112b0bd455dc0a

Contents?: true

Size: 431 Bytes

Versions: 1

Compression:

Stored size: 431 Bytes

Contents

module Commands::Activities::Activity
  class Destroy < RestPack::Service::Command
    required do
      integer :id
      integer :application_id
    end

    def execute
      activity = Models::Activities::Activity.find_by_id_and_application_id(
        inputs[:id],
        inputs[:application_id]
      )

      if activity
        activity.destroy
        nil
      else
        status :not_found
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
restpack_activity_service-0.0.13 lib/restpack_activity_service/commands/activity/destroy.rb