views:

137

answers:

1

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.

A: 

I get the same problem when trying to search using datamapper on appengien

now = Time.now    
Post.all(:user=>current_user, :date=>now, :order => [ :date.asc ])

I've tried the instance name date, created_at both didn't work. also tried Date, DateTime, Time with no success. even passing a string to :date=>"xxx" throws an exception. and when I enter a number :date=>3 it works but then date.gt=>3 and date.lt=>3 brings nothing back when one of them should defenetly bring all the records.

removing the :date=>.. returns many results.

hope some1 figured it out.

Roy