cast_code = column.type_cast_code('v') return null

32 views
Skip to first unread message

Michael Yao

unread,
Nov 7, 2011, 5:17:18 PM11/7/11
to Composite Keys for ActiveRecord
hi,

I am new in RoR. I am trying to use composite_primary_key gem.
However, when i try to create a model object, i got following error:

NoMethodError: undefined method `match' for nil:NilClass
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/
lib/active_support/whiny_nil.rb:48:in `method_missing'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/
composite_primary_keys-4.1.1/lib/composite_primary_keys/
attribute_methods/read.rb:11:in `define_read_method'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.1/
lib/active_record/attribute_methods/read.rb:48:in
`define_method_attribute'

after i traced in, i noticed that column.type_cast_code('v') returns
null.

My question: What does the 'v" mean over here? I searched through web,
and can not find anywhere explain what are we trying to do using 'v'
as parameter.

any hint is appreciated.

Thanks

Michael Yao

cfis

unread,
Nov 20, 2011, 11:14:36 PM11/20/11
to Composite Keys for ActiveRecord
Hi Michael,

That code is taken straight from Rails, see read.rb in active record.
Not sure what it does....

Charlie

Reply all
Reply to author
Forward
0 new messages