I've got a bit of a "newbie" question, and I apologize in advance for
any frustration it causes.

I have a model, such as:

class Entry
 include DataMapper::Resource
 property :id, Serial
 property :horse, Text, :required => true, :message => "A horse name
is required for this entry."
end

if I fire up my sinatra app via "irb -r myapp.rb" and execute this
code:

e = Entry.new

e.valid? returns true.

If I change the model, removing :required => true... and instead
including a line:

validates_presend :horse, :message ...

that same e.valid? will return false.

What am I doing wrong?  The only thing I can think of is that
Entry.new initially sets e.horse to nil and :required sees nil as ...
there.

Again,

Thank you.

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

Reply via email to