Module: PaperTrailAssociationTracking::Config

Defined in:
lib/paper_trail_association_tracking/config.rb

Instance Method Summary collapse

Instance Method Details

#association_reify_error_behaviourObject


14
15
16
# File 'lib/paper_trail_association_tracking/config.rb', line 14

def association_reify_error_behaviour
  @association_reify_error_behaviour ||= "error"
end

#association_reify_error_behaviour=(val) ⇒ Object


5
6
7
8
9
10
11
12
# File 'lib/paper_trail_association_tracking/config.rb', line 5

def association_reify_error_behaviour=(val)
  val = val.to_s
  if ['error', 'warn', 'ignore'].include?(val.to_s)
    @association_reify_error_behaviour = val.to_s
  else
    raise ArgumentError.new('Incorrect value passed to `association_reify_error_behaviour`')
  end
end

#track_associations=(val) ⇒ Object


18
19
20
# File 'lib/paper_trail_association_tracking/config.rb', line 18

def track_associations=(val)
  @track_associations = !!val
end

#track_associations?Boolean

Returns:

  • (Boolean)

22
23
24
# File 'lib/paper_trail_association_tracking/config.rb', line 22

def track_associations?
  !!@track_associations
end