Sha256: 239279cd94c79e9608e271c96619fd79999523d60c40d611e7af0bacfb7cd807

Contents?: true

Size: 539 Bytes

Versions: 20

Compression:

Stored size: 539 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  class Deprecation #:nodoc
    include Singleton

    # Alert of a deprecation. This will delegate to the logger and call warn on
    # it.
    #
    # Example:
    #
    # <tt>deprecation.alert("Method no longer used")</tt>
    def alert(message)
      @logger.warn("Deprecation: #{message}")
    end

    protected
    # Instantiate a new logger to stdout or a rails logger if available.
    def initialize
      @logger = defined?(Rails) ? Rails.logger : Logger.new($stdout)
    end
  end
end

Version data entries

20 entries across 20 versions & 6 rubygems

Version Path
mongoid-1.9.5 lib/mongoid/deprecation.rb
mongoid-with-auth-1.9.4 lib/mongoid/deprecation.rb
mongoid-rails2-1.9.4 lib/mongoid/deprecation.rb
mongoid-rails2-1.9.3 lib/mongoid/deprecation.rb
mongoid-1.9.2 lib/mongoid/deprecation.rb
sskirby-mongoid-1.9.1 lib/mongoid/deprecation.rb
mongoid-2.0.0.beta.7 lib/mongoid/deprecation.rb
mongoid-2.0.0.beta.8 lib/mongoid/deprecation.rb
mongoid-2.0.0.beta.9 lib/mongoid/deprecation.rb
mongoid-1.9.1 lib/mongoid/deprecation.rb
chhean-mongoid-2.0.1.beta1 lib/mongoid/deprecation.rb
mongoid-2.0.0.beta.5 lib/mongoid/deprecation.rb
mongoid-1.9.0 lib/mongoid/deprecation.rb
mongoid-pre-2.0.0.beta1 lib/mongoid/deprecation.rb
mongoid-2.0.0.alpha lib/mongoid/deprecation.rb
mongoid-1.2.14 lib/mongoid/deprecation.rb
mongoid-1.2.13 lib/mongoid/deprecation.rb
mongoid-1.2.12 lib/mongoid/deprecation.rb
mongoid-1.2.11 lib/mongoid/deprecation.rb
mongoid-1.2.10 lib/mongoid/deprecation.rb