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-7.9.0 app/models/concerns/deletable.rb
udongo-7.8.1 app/models/concerns/deletable.rb
udongo-7.8.0 app/models/concerns/deletable.rb
udongo-7.7.2 app/models/concerns/deletable.rb
udongo-7.7.1 app/models/concerns/deletable.rb
udongo-7.7.0 app/models/concerns/deletable.rb
udongo-7.6.2 app/models/concerns/deletable.rb
udongo-7.6.1 app/models/concerns/deletable.rb
udongo-7.6.0 app/models/concerns/deletable.rb
udongo-7.5.1 app/models/concerns/deletable.rb
udongo-7.5.0 app/models/concerns/deletable.rb
udongo-7.4.2 app/models/concerns/deletable.rb
udongo-7.4.1 app/models/concerns/deletable.rb
udongo-7.4.0 app/models/concerns/deletable.rb
udongo-7.3.5 app/models/concerns/deletable.rb
udongo-7.3.4 app/models/concerns/deletable.rb
udongo-7.3.3 app/models/concerns/deletable.rb
udongo-7.3.2 app/models/concerns/deletable.rb
udongo-7.3.1 app/models/concerns/deletable.rb
udongo-7.2.1 app/models/concerns/deletable.rb