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
| 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) |
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 '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, |
NewerOlder