Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (23 sloc) 818 Bytes
require File.expand_path(File.dirname(__FILE__) + "/../lib/simple_record")
require_relative 'my_model'
class MyChildModel < SimpleRecord::Base
belongs_to :my_model
belongs_to :x, :class_name=>"MyModel"
has_attributes :name, :child_attr
puts 'word'
mm =
puts 'word2'
mcm =
puts 'mcm instance methods=' + MyChildModel.instance_methods(true).inspect
#puts 'mcm=' + mcm.instance_methods(false)
puts 'mcm class vars = ' + mcm.class.class_variables.inspect
puts mcm.class == MyChildModel
puts 'saved? ' +
puts mm.errors.inspect
puts "mm attributes=" + MyModel.defined_attributes.inspect
puts "mcm attributes=" + MyChildModel.defined_attributes.inspect
mcm2 =
puts "mcm2 attributes=" + MyChildModel.defined_attributes.inspect
Something went wrong with that request. Please try again.