Sha256: 2b5c2edf9acef8156dfd5cee8a4d956ef3ca0837ee3b383278a5b05589e28f4b

Contents?: true

Size: 303 Bytes

Versions: 72

Compression:

Stored size: 303 Bytes

Contents

# If you want to use this concern, you need to add a boolean field 'deletable' to
# the model.
module Concerns
  module Deletable
    extend ActiveSupport::Concern

    included do
      after_initialize do
        self.deletable = true if self.new_record? && deletable.nil?
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
udongo-6.3.1 app/models/concerns/deletable.rb
udongo-6.3.0 app/models/concerns/deletable.rb
udongo-6.2.1 app/models/concerns/deletable.rb
udongo-6.2.0 app/models/concerns/deletable.rb
udongo-6.1.0 app/models/concerns/deletable.rb
udongo-6.0.0 app/models/concerns/deletable.rb
udongo-5.9.0 app/models/concerns/deletable.rb
udongo-5.8.0 app/models/concerns/deletable.rb
udongo-5.7.0 app/models/concerns/deletable.rb
udongo-5.6.0 app/models/concerns/deletable.rb
udongo-5.5.0 app/models/concerns/deletable.rb
udongo-5.4.0 app/models/concerns/deletable.rb
udongo-5.3.1 app/models/concerns/deletable.rb
udongo-5.3.0 app/models/concerns/deletable.rb
udongo-5.2.0 app/models/concerns/deletable.rb
udongo-5.1.0 app/models/concerns/deletable.rb
udongo-5.0.2 app/models/concerns/deletable.rb
udongo-5.0.1 app/models/concerns/deletable.rb
udongo-5.0.0 app/models/concerns/deletable.rb
udongo-4.0.0 app/models/concerns/deletable.rb