Sha256: a9c8d693f557f29355ef453cc7f35f8767fa92abfd67684b5c79b87c277619ab

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

module PaperTrailAssociationTracking
  module Config
    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

    def association_reify_error_behaviour
      @association_reify_error_behaviour ||= "error"
    end
    
    def track_associations=(val)
      @track_associations = !!val
    end 

    def track_associations?
      !!@track_associations
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paper_trail-association_tracking-0.0.1 lib/paper_trail_association_tracking/config.rb