what's been difficult about using active record?
can you post snippets of your current code and then maybe we can
rewrite it using AR?

-Gabe

On Jun 22, 9:58 am, Jedrin <jrubia...@gmail.com> wrote:
>  I've had that book ever since it came out, and have tried to work on
> this problem using the book as well.
>
>  What I seem to recall is that belongs_to, has_many, or anything
> similar is not that easy to figure out how to get it to work, at least
> I have not had good luck with it.
> I find it easier that when the rails server calls a drb process and on
> some other machine on the network and that process needs to use active
> resource, I just pass an array of record id's through drb and then drb
> can do rec.find(id) which works fine. Then if I have a relationship, I
> just handle it manually by setting say rec.parent_id. Other types of
> find() may cause the server to send over all the records for it to
> search through which can be a problem if there are too many records.
>
>  This seems kludgy, but that's what I have been doing ever since I
> gave up on trying to figure this out as it seemed there where not
> enough good examples or those that I found I had problems getting to
> work.
>
> On Jun 21, 5:25 pm, Rick <richard.t.ll...@gmail.com> wrote:
>
> > Right.  You might want to look at Chap 15 in "The Rails Way", Obie
> > Fernandez et.al., 2008.  It covers XML and ActiveResource - only 27
> > pages but the best I've been able to find to date.  I'm assuming that
> > what you mean by "complex relationships" is the A...Resource parallel
> > to associations in A...Record.  If not, clue me in with more details.
>
> > On Jun 19, 2:47 pm, Jedrin <jrubia...@gmail.com> wrote:
>
> > >  What I mean is active resource over a web service so that you run a
> > > ruby script outside of rails remotely and access the active record
> > > objects in the rails service over http as active resource provides and
> > > still have the complex relationships, that second part I have found
> > > tricky
>
> > > On Jun 19, 1:40 pm,Rick<richard.t.ll...@gmail.com> wrote:
>
> > > > You might take a look at:http://guides.rubyonrails.org/
>
> > > > Once you get there follow the links to the different Model topics, in
> > > > particular check 
> > > > out:http://guides.rubyonrails.org/association_basics.html
>
> > > > On Jun 19, 11:52 am, Jedrin <jrubia...@gmail.com> wrote:
>
> > > > > I tried to work out an active resource example with complex
> > > > > relationships between records and had not much luck so I gave up and
> > > > > manipulate *_id fields myself to get around this in a somewhat cludgy
> > > > > way at times. I am wondering if there are any good books with examples
> > > > > on this ? I have the agile web book 2, does book 3 go into this in
> > > > > greater depth ?
--~--~---------~--~----~------------~-------~--~----~
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