class PaperTrail::Config

Global configuration affecting all threads. Some thread-specific configuration can be found in `paper_trail.rb`, others in `controller.rb`.

Attributes

association_reify_error_behaviour[RW]
has_paper_trail_defaults[RW]
mongo_config[RW]
mongo_prefix[RW]
object_changes_adapter[RW]
serializer[RW]
version_limit[RW]

Public Class Methods

new() click to toggle source
# File lib/mongo_trails/config.rb, line 22
def initialize
  # Variables which affect all threads, whose access is synchronized.
  @mutex = Mutex.new
  @enabled = true

  # Variables which affect all threads, whose access is *not* synchronized.
  @serializer = PaperTrail::Serializers::YAML
  @has_paper_trail_defaults = {}
end

Public Instance Methods

enabled() click to toggle source

Indicates whether PaperTrail is on or off. Default: true.

# File lib/mongo_trails/config.rb, line 33
def enabled
  @mutex.synchronize { !!@enabled }
end
enabled=(enable) click to toggle source
# File lib/mongo_trails/config.rb, line 37
def enabled=(enable)
  @mutex.synchronize { @enabled = enable }
end