6 Replies Latest reply on Nov 26, 2012 7:15 AM by Steve Zhang

    does Rhodes support ruby alias_method feature or not?

      I found alias_method works in the RhoStudio simulator,

      but today when I tested the app on the android device, I got the undefined_method

      exception, it seems alias_method is not supported in Android platform

       

      I just want to confirm the if alias_method is not supported in any device platform?

       

      And can we get the list of unsupported ruby feature from Rhomobile site?

       

      Following is the code snippet.

       

       

       

      class Note

          include Rhom::FixedSchema

       

      .....

      .....

       

      class << self

          alias_method :create_original, :create

         end

        

        def self.create(attributes)

         # save_snapshot

          note = Note.create_original(attributes)   

          note.save_snapshot

          note

        end

       

        def save_snapshot

          snapshot = Snapshot.find(:first).get_latest   

          self.update_attributes("timeStamp" => snapshot.timestamp,

            "latitude" => snapshot.latitude.to_f,

            "longitude" => snapshot.longitude.to_f)

        end

       

      end