Sha256: 20394a26c021315d1529465c272167a937b6d992777064b4c96e75bdca1b56e1

Contents?: true

Size: 644 Bytes

Versions: 9

Compression:

Stored size: 644 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

9 entries across 9 versions & 1 rubygems

Version Path
paper_trail-association_tracking-2.2.1 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-2.2.0 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-2.1.3 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-2.1.1 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-2.1.0 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-2.0.0 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-1.1.1 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-1.1.0 lib/paper_trail_association_tracking/config.rb
paper_trail-association_tracking-1.0.0 lib/paper_trail_association_tracking/config.rb