Module: Mongoid::Config::Defaults
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Defined in: | lib/mongoid/config/defaults.rb |
Overview
Encapsulates logic for loading defaults.
Instance Method Summary
-
#load_defaults(version)
Load the defaults for the feature flags in the given
::Mongoid
version.
Instance Method Details
#load_defaults(version)
# File 'lib/mongoid/config/defaults.rb', line 17
def load_defaults(version) case version.to_s when /^[0-7]\./ raise ArgumentError, "Version no longer supported: #{version}" when "8.0" self.legacy_readonly = true load_defaults "8.1" when "8.1" self.immutable_ids = false self.legacy_persistence_context_behavior = true self. = true self. = false load_defaults "9.0" when "9.0" # All flag defaults currently reflect 9.0 behavior. else raise ArgumentError, "Unknown version: #{version}" end end