Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Created March 4, 2011 18:44
Show Gist options
  • Save JakubOboza/855473 to your computer and use it in GitHub Desktop.
Save JakubOboza/855473 to your computer and use it in GitHub Desktop.
class Cat
include Mongoid::Document
include ActiveModel::Validations
# fields
field :name
field :url, :type => String
# validations
validates_uniqueness_of :name
validates_format_of :url, :with => /http:\/\/.+/ # lets keep it small
end
Pending:
Application should earn loads of money
# Not Yet Implemented
# ./spec/application_spec.rb:6
Finished in 0.08652 seconds
3 examples, 0 failures, 1 pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment