2 Replies Latest reply on Aug 23, 2014 4:49 AM by Anny Wink

    undefined method `find' for Rho::RhoEvent:Module

    Graham Downs

      Hi, All


      I needed a way to find all events in a device's calendar. After some searching, I found this: Rhomobile | Rho::RhoEvent API. It's for RhoMobile 2.2.0, and I'm using RhoMoble 4.0.0, but I couldn't find any equivalents for 4.0.0, so I thought I'd use it anyway.


      I copied the following code out of the documentation, pasted it into my application, and ran it:


      start = Time.utc(2010, 'jan', 1, 0, 0, 0)

      finish = Time.utc(2012, 'dec', 31, 23, 59, 59)

      @@events = Rho::RhoEvent.find(:all, :start_date => start,

         :end_date => finish, :find_type => 'starting',

         :include_repeating => true)


      On the RhoEvent.find line, the application throws an error: undefined method `find' for Rho::RhoEvent:Module.


      I can call create! to create new events, which works fine, as does update_attributes, as does calling find and passing it an event ID. But find(:all) gives the above error, as does the one in the example above.


      I've tested this on the RhoSimulator, as well as on an iPad. Oh, and I have added calendar to my capabilities section in build.yml.


      Does anyone have any idea what could be causing my problem?