Sha256: c8526f5d41461d1563a3e43d42e35015fad185f8bb44a5f0e731a9cd5c1fac4c

Contents?: true

Size: 308 Bytes

Versions: 159

Compression:

Stored size: 308 Bytes

Contents

module Fields::BooleanSupport
  extend ActiveSupport::Concern

  def assign_boolean(strong_params, attribute)
    attribute = attribute.to_s
    if strong_params.dig(attribute).present?
      strong_params[attribute] = ActiveModel::Type::Boolean.new.cast(strong_params[attribute]) || false
    end
  end
end

Version data entries

159 entries across 159 versions & 1 rubygems

Version Path
bullet_train-fields-1.6.12 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.11 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.10 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.9 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.8 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.7 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.6 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.5 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.4 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.3 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.2 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.1 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.6.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.5.2 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.5.1 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.5.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.11 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.10 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.9 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.8 app/controllers/concerns/fields/boolean_support.rb