[Rails] Re: Creating Complex ActiveResource objects

2009-04-07 Thread Carl Fyffe

The "convert a local array to xml" is where I am running into issues.
I keep trying to set a "pings" property but it isn't working. How do I
shove that into the Uptime object so that they are all transmitted at
the same time?

On Tue, Apr 7, 2009 at 4:16 AM, glennswest  wrote:
>
> Yes you would normally update pings as they occur, unless your
> thinking of submitting
> a xml and doing a bulk update. So the "pinger" is doing a butch of
> pings, then
> sending the results to the backend?
> Then you just need to convert a local array to a xml file and submit
> it to your Restful web app.
>
>
> On Apr 7, 6:45 am, Carl Fyffe  wrote:
>> Given the following models:
>>
>> class Uptime < ActiveRecord::Base
>>   has_many :pings
>> end
>>
>> class Ping < ActiveRecord::Base
>>   belongs_to :uptime
>> end
>>
>> I can create an ActiveResource that will get the uptimes and ping models:
>>
>> class UptimeResource < ActiveResource::Base
>>   self.site = "http://localhost:3000";
>>   self.element_name = "uptime"
>> end
>>
>> class PingResource < UptimeResource
>>   self.element_name = "ping"
>> end
>>
>> If the information exists in the database, I can do
>> UptimeResource.find(1).pings and get a list of pings. But how can I
>> create pings besides creating an UptimeResource and then creating the
>> pings separately. I am trying to save the XML into an XML Database and
>> bypass a relational database (client requirements). I wish I had
>> something like CouchDB_fu but for XML databases...
>>
>> Is this a job for DataMapper? I am open to any strategy. Swift kicks
>> to the head welcome.
>>
>> Carl
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Re: Creating Complex ActiveResource objects

2009-04-07 Thread glennswest

Yes you would normally update pings as they occur, unless your
thinking of submitting
a xml and doing a bulk update. So the "pinger" is doing a butch of
pings, then
sending the results to the backend?
Then you just need to convert a local array to a xml file and submit
it to your Restful web app.


On Apr 7, 6:45 am, Carl Fyffe  wrote:
> Given the following models:
>
> class Uptime < ActiveRecord::Base
>   has_many :pings
> end
>
> class Ping < ActiveRecord::Base
>   belongs_to :uptime
> end
>
> I can create an ActiveResource that will get the uptimes and ping models:
>
> class UptimeResource < ActiveResource::Base
>   self.site = "http://localhost:3000";
>   self.element_name = "uptime"
> end
>
> class PingResource < UptimeResource
>   self.element_name = "ping"
> end
>
> If the information exists in the database, I can do
> UptimeResource.find(1).pings and get a list of pings. But how can I
> create pings besides creating an UptimeResource and then creating the
> pings separately. I am trying to save the XML into an XML Database and
> bypass a relational database (client requirements). I wish I had
> something like CouchDB_fu but for XML databases...
>
> Is this a job for DataMapper? I am open to any strategy. Swift kicks
> to the head welcome.
>
> Carl
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---