Created
February 15, 2013 15:46
-
-
Save djbender/4961205 to your computer and use it in GitHub Desktop.
this is in Mongoid 2ish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mongoid' | |
class Foo | |
include Mongoid::Document | |
field :bar, :type => String | |
validates_uniquness_of :bar | |
end | |
foo = Foo.new | |
foo.valid? | |
# => MONGODB (0ms) foo['$cmd'].find({:ismaster=>1}).limit(-1) │ | |
# TypeError: db_name must be a string or symbol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mongoid' | |
class Foo | |
include Mongoid::Document | |
field :bar, :type => String | |
end | |
foo = Foo.new | |
foo.valid? # => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment