Module: Fortitude::Widget::TemporaryOverrides

Extended by:
ActiveSupport::Concern
Included in:
Fortitude::Widget
Defined in:
lib/fortitude/widget/temporary_overrides.rb

Instance Method Summary collapse

Instance Method Details

#with_attribute_rules(on_or_off) ⇒ Object

PUBLIC API

Raises:

  • (ArgumentError)


16
17
18
19
# File 'lib/fortitude/widget/temporary_overrides.rb', line 16

def with_attribute_rules(on_or_off)
  raise ArgumentError, "We aren't even enforcing attribute rules in the first place" if on_or_off && (! self.class.enforce_attribute_rules)
  @_fortitude_rendering_context.with_attribute_validation(on_or_off) { yield }
end

#with_element_nesting_rules(on_or_off) ⇒ Object

PUBLIC API

Raises:

  • (ArgumentError)


10
11
12
13
# File 'lib/fortitude/widget/temporary_overrides.rb', line 10

def with_element_nesting_rules(on_or_off)
  raise ArgumentError, "We aren't even enforcing nesting rules in the first place" if on_or_off && (! self.class.enforce_element_nesting_rules)
  @_fortitude_rendering_context.with_element_nesting_validation(on_or_off) { yield }
end

#with_id_uniqueness(on_or_off) ⇒ Object

PUBLIC API

Raises:

  • (ArgumentError)


22
23
24
25
# File 'lib/fortitude/widget/temporary_overrides.rb', line 22

def with_id_uniqueness(on_or_off)
  raise ArgumentError, "We aren't even enforcing ID uniqueness in the first place" if on_or_off && (! self.class.enforce_id_uniqueness)
  @_fortitude_rendering_context.with_id_uniqueness(on_or_off) { yield }
end