Sha256: 57a4de75883a6f9915d0f5f9adf347a33e5040a655c637f068633c96bf4de734

Contents?: true

Size: 673 Bytes

Versions: 18

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

require "much-rails/mixin"
require "much-rails/records/validate_destroy"

module MuchRails; end
module MuchRails::Records; end

# MuchRails::Records::AlwaysDestroyable is a mix-in to always enable destroying
# a record. It mixes-in MuchRails::Records::ValidateDestroy and hard-codes
# never adding destruction error messages.
module MuchRails::Records::AlwaysDestroyable
  include MuchRails::Mixin

  mixin_included do
    include MuchRails::Records::ValidateDestroy
  end

  mixin_instance_methods do
    def destruction_error_messages
      []
    end

    private

    def validate_destroy
      # Do nothing on purpose.
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
much-rails-0.4.3 lib/much-rails/records/always_destroyable.rb
much-rails-0.4.2 lib/much-rails/records/always_destroyable.rb
much-rails-0.4.1 lib/much-rails/records/always_destroyable.rb
much-rails-0.4.0 lib/much-rails/records/always_destroyable.rb
much-rails-0.3.0 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.8 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.7 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.6 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.5 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.4 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.3 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.2 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.1 lib/much-rails/records/always_destroyable.rb
much-rails-0.2.0 lib/much-rails/records/always_destroyable.rb
much-rails-0.1.3 lib/much-rails/records/always_destroyable.rb
much-rails-0.1.2 lib/much-rails/records/always_destroyable.rb
much-rails-0.1.1 lib/much-rails/records/always_destroyable.rb
much-rails-0.1.0 lib/much-rails/records/always_destroyable.rb