Module: HasHelpers::Concerns::HydrateConcern

Extended by:
ActiveSupport::Concern
Defined in:
lib/has_helpers/concerns/hydrate_concern.rb

Instance Method Summary collapse

Instance Method Details

#hydrate(**kwargs) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/has_helpers/concerns/hydrate_concern.rb', line 30

def hydrate(**kwargs)
  @_hydrated_fields = []
  self.class._hydrate_fields.each do |field, config|
    run_hydration(field, config[:block], **kwargs) unless [:validation, :save, :update].include?(config[:on])
  end
  self
end

#hydrated_fieldsObject



38
39
40
# File 'lib/has_helpers/concerns/hydrate_concern.rb', line 38

def hydrated_fields
  @_hydrated_fields || []
end