Sha256: d40429b44a8f7456dd6c3b70e9cd7b217e5cc33985a971226a04f3b398b8b196

Contents?: true

Size: 515 Bytes

Versions: 170

Compression:

Stored size: 515 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Extensions #:nodoc:
    module Symbol #:nodoc:

      # This module has object checks in it.
      module Checks #:nodoc:

        # Is the symbol a valid value for a Mongoid id?
        #
        # @example Is the string an id value?
        #   :_id.mongoid_id?
        #
        # @return [ true, false ] If the symbol is :id or :_id.
        #
        # @since 2.3.1
        def mongoid_id?
          to_s =~ /^(|_)id$/
        end
      end
    end
  end
end

Version data entries

170 entries across 78 versions & 4 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.5 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.4 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.3 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/extensions/symbol/checks.rb
mongoid-2.8.1 lib/mongoid/extensions/symbol/checks.rb
mongoid-2.8.0 lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.2 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.1 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/extensions/symbol/checks.rb
classiccms-0.7.0 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/extensions/symbol/checks.rb