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-3.0.0 app/models/concerns/deletable.rb
udongo-2.0.4 app/models/concerns/deletable.rb
udongo-2.0.3 app/models/concerns/deletable.rb
udongo-2.0.2 app/models/concerns/deletable.rb
udongo-2.0.1 app/models/concerns/deletable.rb
udongo-2.0.0 app/models/concerns/deletable.rb
udongo-1.0.4 app/models/concerns/deletable.rb
udongo-1.0.3 app/models/concerns/deletable.rb
udongo-1.0.2 app/models/concerns/deletable.rb
udongo-1.0.1 app/models/concerns/deletable.rb
udongo-1.0.0 app/models/concerns/deletable.rb
udongo-0.1.0 app/models/concerns/deletable.rb