Sha256: 4a90f1b50ecb5f74277b8f5a0a3250dcd813c34ea3a9409b0330a731c3f22c73

Contents?: true

Size: 521 Bytes

Versions: 103

Compression:

Stored size: 521 Bytes

Contents

module AttributesHelper
  def current_attributes_object
    @_current_attribute_settings&.dig(:object)
  end

  def current_attributes_strategy
    @_current_attribute_settings&.dig(:strategy)
  end

  def with_attribute_settings(object: current_attributes_object, strategy: current_attributes_strategy)
    old_attribute_settings = @_current_attribute_settings
    @_current_attribute_settings = {object: object, strategy: strategy}
    yield
  ensure
    @_current_attribute_settings = old_attribute_settings
  end
end

Version data entries

103 entries across 103 versions & 2 rubygems

Version Path
bullet_train-fields-1.15.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.14.2 app/helpers/attributes_helper.rb
bullet_train-fields-1.14.1 app/helpers/attributes_helper.rb
bullet_train-fields-1.14.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.13.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.12.3 app/helpers/attributes_helper.rb
bullet_train-fields-1.12.2 app/helpers/attributes_helper.rb
bullet_train-fields-1.12.1 app/helpers/attributes_helper.rb
bullet_train-fields-1.12.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.11.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.10.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.9.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.8.5 app/helpers/attributes_helper.rb
bullet_train-fields-1.8.4 app/helpers/attributes_helper.rb
bullet_train-fields-1.8.3 app/helpers/attributes_helper.rb
bullet_train-fields-1.8.2 app/helpers/attributes_helper.rb
bullet_train-fields-1.8.1 app/helpers/attributes_helper.rb
bullet_train-fields-1.8.0 app/helpers/attributes_helper.rb
bullet_train-fields-1.7.23 app/helpers/attributes_helper.rb
bullet_train-fields-1.7.22 app/helpers/attributes_helper.rb