lib/mongoid.rb in mongoid-3.0.23 vs lib/mongoid.rb in mongoid-3.1.0

- old
+ new

@@ -18,10 +18,13 @@ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +require 'support/ruby_version' + require "delegate" require "time" require "set" require "active_support/core_ext" @@ -31,10 +34,11 @@ require "active_model" require "origin" require "moped" +require "mongoid/atomic/positionable" require "mongoid/evolvable" require "mongoid/extensions" require "mongoid/errors" require "mongoid/threaded" require "mongoid/relations" @@ -42,10 +46,11 @@ require "mongoid/attributes" require "mongoid/callbacks" require "mongoid/config" require "mongoid/contextual" require "mongoid/copyable" +require "mongoid/equality" require "mongoid/criteria" require "mongoid/dirty" require "mongoid/factory" require "mongoid/fields" require "mongoid/finders" @@ -122,10 +127,22 @@ # @since 3.0.0 def default_session Sessions.default end + # Disconnect all active sessions. + # + # @example Disconnect all active sessions. + # Mongoid.disconnect_sessions + # + # @return [ true ] True. + # + # @since 3.1.0 + def disconnect_sessions + Sessions.disconnect + end + # Convenience method for getting a named session. # # @example Get a named session. # Mongoid.session(:default) # @@ -142,8 +159,8 @@ # @example Delegate the configuration methods. # Mongoid.database = Mongo::Connection.new.db("test") # # @since 1.0.0 delegate(*(Config.public_instance_methods(false) + - ActiveModel::Observing::ClassMethods.public_instance_methods(false) << + ActiveModel::Observing::ClassMethods.public_instance_methods(false) - [:logger=, :logger] << { to: Config })) end