hook arguments/documentation error?

4 views
Skip to first unread message

handler

unread,
May 26, 2010, 2:59:08 PM5/26/10
to DataMapper
i'm having trouble figuring out the usage of hooks. in the
documentation it shows this:

1 class Post
2 include DataMapper::Resource
3
4 # ... key and properties here
5
6 # This record will save properly
7 before :save do |post|
8 true
9 end
10

(from http://datamapper.org/docs/callbacks)

but when i do this, the object passed into the block is the value
"true", ie:

before :save do |post|
puts post
end

puts "true" to the console


am i doing it wrong?

Reply all
Reply to author
Forward
0 new messages