oh, so that's what lazy loading is about!
my fault, didn't know. of course

puts ss.foo

works as intended.
good news is i've finally understood what lazy loading is.

thanks

On 9 Feb, 23:51, casual <kab...@gmail.com> wrote:
> I just tried that and don't have the problem. What dm-core version is
> this for?
>
> Also, 'ss = Stuff.get 1 # => #<Stuff @id=1 @foo=<not loaded>>' Is
> because the Yaml type is lazy loaded, so you can just set:
> <code>property  :foo, Yaml, :lazy => false</code>
>
> On Feb 9, 3:45 pm, fffact <fuffafact...@gmail.com> wrote:
>
>
>
> > hi all,
> > can't load property of type Yaml, like this:
>
> > require 'rubygems'
> > require 'dm-core'
> > require 'dm-types'
>
> > DataMapper.setup(:default, 'sqlite3::memory:')
>
> > class Stuff
> >   include DataMapper::Resource
> >   property  :id, Serial
> >   property  :foo, Yaml
> > end
>
> > Stuff.auto_migrate!
> > s = Stuff.create
> > s.foo = 'bar' # !> instance variable @field_types not initialized
> > s.save
> > ss = Stuff.get 1 # => #<Stuff @id=1 @foo=<not loaded>>
>
> > i really can't figure out what is wrong with this code, which seems
> > straightforward to me. can you help me?
> > thanks

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamap...@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to