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.14.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.13.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.12.3 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.12.2 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.12.1 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.12.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.11.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.10.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.9.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.8.5 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.8.4 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.8.3 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.8.2 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.8.1 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.8.0 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.7.23 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.7.22 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.7.21 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.7.20 app/controllers/concerns/fields/boolean_support.rb
bullet_train-fields-1.7.19 app/controllers/concerns/fields/boolean_support.rb