Sha256: 58eb266abdd447ffbba02804ff0cee50f0230af3980be81f2ada6756eb7b60ac

Contents?: true

Size: 327 Bytes

Versions: 7

Compression:

Stored size: 327 Bytes

Contents

module Commons
  module Concerns
    module Validations
      module Undestroyable
        extend ActiveSupport::Concern
        included do
          before_destroy :prevent_destroy
        end

        private

        def prevent_destroy
          raise Commons::Errors::Unauthorized
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
commons_yellowme-0.16.0 lib/commons/concerns/validations/undestroyable.rb
commons_yellowme-0.15.0 lib/commons/concerns/validations/undestroyable.rb
commons_yellowme-0.12.0 lib/commons/concerns/validations/undestroyable.rb
commons_yellowme-0.11.3 lib/commons/concerns/validations/undestroyable.rb
commons_yellowme-0.11.2 lib/commons/concerns/validations/undestroyable.rb
commons_yellowme-0.11.1 lib/commons/concerns/validations/undestroyable.rb
commons_yellowme-0.11.0 lib/commons/concerns/validations/undestroyable.rb