Skip to content

Instantly share code, notes, and snippets.

context "new?" do
setup do
@document.class_eval do
key :foo, Address
end
end
should "be new until document is saved" do
address = Address.new(:city => 'South Bend', :state => 'IN')
doc = @document.new(:foo => address)
require 'test_helper'
module CallbackModelTemplate
def self.included(model)
model.class_eval do
key :name, String
has_many :sons, :class_name => 'CallbacksTest::Son'
[ :before_validation_on_create, :before_validation_on_update,
:before_validation, :after_validation,