Luke van der Hoeven wrote:
> 
> Any idea on how to solve this or to get the data back from that pointer?
> Thanks.
> 
> Alternatively, does anyone know if PassiveRecord solves this problem?

First of all, it's not a pointer..
Secondly, the object is being passed from a web client most probably on 
another host back to your web server.. how could it be resolved by 
de-referencing a pointer?

NOT TESTED.. just ideas to get you started..

If you make your initialize method look like this:

class HsdPair

  def initialize(hsd)
    if(hsd.kind_of? Map)
      @current_display = hsd[:current_display] || 0
      @has_changed_flag = hsd[:has_changed_flag] || false
      @hsd = hsd[:hsd] || raise "hsd attribute missing"
    else
      @current_display = 0
      @has_changed_flag = false
      @hsd = hsd
    end
  end

  # Much more elegant ways to do this but not sure if you are on 1.8 or 
1.9
  def to_params()
     {:current_display => @current_display, :has_changed_flag => 
@has_changed_flag, :hsd => @hsd}
  end
end

Then you can reconstruct the object on the server side by calling 
HsdPair.new(params)

hth

ilan

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to