Sha256: f01df7c2e546a9f93d4ba4d244485ab82c24c020d97eebce42b1f3982f6a3fb1

Contents?: true

Size: 522 Bytes

Versions: 14

Compression:

Stored size: 522 Bytes

Contents

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

  def current_attributes_strategy
    @_current_attributes_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

14 entries across 14 versions & 1 rubygems

Version Path
bullet_train-1.3.13 app/helpers/attributes_helper.rb
bullet_train-1.3.12 app/helpers/attributes_helper.rb
bullet_train-1.3.11 app/helpers/attributes_helper.rb
bullet_train-1.3.10 app/helpers/attributes_helper.rb
bullet_train-1.3.9 app/helpers/attributes_helper.rb
bullet_train-1.3.8 app/helpers/attributes_helper.rb
bullet_train-1.3.7 app/helpers/attributes_helper.rb
bullet_train-1.3.6 app/helpers/attributes_helper.rb
bullet_train-1.3.5 app/helpers/attributes_helper.rb
bullet_train-1.3.4 app/helpers/attributes_helper.rb
bullet_train-1.3.3 app/helpers/attributes_helper.rb
bullet_train-1.3.2 app/helpers/attributes_helper.rb
bullet_train-1.3.1 app/helpers/attributes_helper.rb
bullet_train-1.3.0 app/helpers/attributes_helper.rb