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.4.7 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.6 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.5 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.4 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.3 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.2 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.1 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.4.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.25 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.24 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.23 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.22 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.21 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.20 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.19 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.18 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.17 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.16 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.15 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.3.14 app/controllers/concerns/fields/boolean_support.rb