Sha256: 1a472c14babc17c55bf23beefc62398af7987c2ae3d92d67d66b1a4a5492d972

Contents?: true

Size: 277 Bytes

Versions: 17

Compression:

Stored size: 277 Bytes

Contents

module Agilibox::DefaultValuesConcern
  extend ActiveSupport::Concern

  def assign_default_values
  end

  def assign_default(attribute, value)
    send("#{attribute}=", value) if send(attribute).nil?
  end

  included do
    after_initialize :assign_default_values
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
agilibox-1.3.5 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.3.4 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.3.3 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.3.2 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.3.1 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.3.0 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.2.3 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.2.2 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.2.1 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.2.0 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.1.0 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.0.15 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.0.14 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.0.13 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.0.12 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.0.11 app/models/concerns/agilibox/default_values_concern.rb
agilibox-1.0.10 app/models/concerns/agilibox/default_values_concern.rb