Saving a 'Date' using DataMapper on AppEngine+JRuby
- by Ryan Montgomery
I have a a model as follows:
class Total
include DataMapper::Resource
property :id, Serial
property :amount, Float, :default => 0.00
property :day, Date
belongs_to :calendar
end
I am trying to select a specific Total from the data-store.
class Calendar
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :totals
def get_total_for(date)
return Total.first(:day => date, :calendar => self)
end
end
When I call get_total_for(DateTime.now) I receive the following error on the call to the data-store.
java.lang.IllegalArgumentException: day:
org.jruby.RubyObject is not a supported property type.
Is Date not allowed for usage in AppEngine? Is this a DataMapper issue? I have tried changing the name of the :day property to something else (hoping it was just a name conflict) but it doesn't seem to matter.
Thanks for any help you can provide.