Skip to content

Instantly share code, notes, and snippets.

View javmorin's full-sized avatar

Mike Javorski javmorin

View GitHub Profile
@javmorin
javmorin / mj-test01_spec.rb
Created February 3, 2011 20:53
Test demonstrating issue with update_attributes and associated objects
require "spec_helper"
describe "Association Validation Inheritance" do
context "#update_attributes" do
before(:all) do
parent = ValInheritanceParent.new
embedded = ValInheritanceEmbed.new(:embed_value => 'start value')
referenced = ValInheritanceRef.new(:ref_value => 'start value')
@javmorin
javmorin / example.rb
Created January 22, 2011 02:09
sample code which causes strange model interaction with multiple inheritance
class Example
include Mongoid::Document
field :example_val
class Holder < HolderBase
embeds_one :item, :class_name => "Example"
end
end