Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
ActiveRecord Adapters
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Henry Maddocks  
View profile  
 More options Jun 30, 7:52 pm
From: Henry Maddocks <henry.maddo...@gmail.com>
Date: Wed, 1 Jul 2009 11:52:38 +1200
Local: Tues, Jun 30 2009 7:52 pm
Subject: ActiveRecord Adapters
My Google fu is failing me today ;(

I am thinking of writing an 'Active Record like' interface to a public  
API (Digital NZ in this case). What's the best way to go about it?

Should I write an adapter?
Should I monkey patch the find methods on Active Record?
Should I avoid Active Record entirely?
Or is there an easier way?

TIA

Henry


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
scottmotte  
View profile  
 More options Jun 30, 8:03 pm
From: scottmotte <sc...@scottmotte.com>
Date: Tue, 30 Jun 2009 17:03:07 -0700 (PDT)
Local: Tues, Jun 30 2009 8:03 pm
Subject: Re: ActiveRecord Adapters
Henry,

I recommend using httparty. Works like a charm for apis.

http://railstips.org/2008/7/29/it-s-an-httparty-and-everyone-is-invited
http://github.com/jnunemaker/httparty/tree/master

You just include it in your model. Here's a post I did on using it,
but you'll find jnunemaker's info more well written:
http://scottmotte.com/archives/218.html

On Jun 30, 11:52 pm, Henry Maddocks <henry.maddo...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henry Maddocks  
View profile  
 More options Jun 30, 8:30 pm
From: Henry Maddocks <henry.maddo...@gmail.com>
Date: Wed, 1 Jul 2009 12:30:47 +1200
Local: Tues, Jun 30 2009 8:30 pm
Subject: Re: [WellRailed] Re: ActiveRecord Adapters

On 1/07/2009, at 12:03 PM, scottmotte wrote:

> I recommend using httparty. Works like a charm for apis.

That's a bit lower level than I was thinking. I've already got the  
http stuff working.

What I'm after is the recommended way to provide the active record  
style interface, eg

find_by_blah :order => 'foo', :limit => 'lots and lots'


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
scottmotte  
View profile  
 More options Jun 30, 9:13 pm
From: scottmotte <sc...@scottmotte.com>
Date: Tue, 30 Jun 2009 18:13:18 -0700 (PDT)
Local: Tues, Jun 30 2009 9:13 pm
Subject: Re: ActiveRecord Adapters
I'm not certain, but I'm pretty sure that means you'd have to go
through the process of creating helpers, packaging them up as a gem -
basically building your own object relational mapper. Not sure what
you're building, but my 2 cents would say that's a lot of work :). My
understanding is that basically activerecord is just a big thing of
syntactic sugar that maps to the low level sql. I'm no expert though.
I've never built an orm or even helped with one so maybe someone else
can chime in.

On Jun 30, 5:30 pm, Henry Maddocks <henry.maddo...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Uckun  
View profile  
 More options Jun 30, 9:22 pm
From: Tim Uckun <timuc...@gmail.com>
Date: Wed, 1 Jul 2009 13:22:07 +1200
Local: Tues, Jun 30 2009 9:22 pm
Subject: Re: [WellRailed] Re: ActiveRecord Adapters

> I recommend using httparty. Works like a charm for apis.

> That's a bit lower level than I was thinking. I've already got the http
> stuff working.
> What I'm after is the recommended way to provide the active record style
> interface, eg
> find_by_blah :order => 'foo', :limit => 'lots and lots'

Maybe something like activeresource?

http://api.rubyonrails.org/classes/ActiveResource/Base.html


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henry Maddocks  
View profile  
 More options Jun 30, 10:42 pm
From: Henry Maddocks <henry.maddo...@gmail.com>
Date: Wed, 1 Jul 2009 14:42:14 +1200
Local: Tues, Jun 30 2009 10:42 pm
Subject: Re: [WellRailed] Re: ActiveRecord Adapters

On 1/07/2009, at 1:22 PM, Tim Uckun wrote:

> Maybe something like activeresource?

Something like it yes. The problem with activeresource is it's only  
useful if you're connecting to another rails app.

Might have a poke around in the code. See what pops up.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Walter McGinnis  
View profile  
 More options Jul 6, 2:52 am
From: Walter McGinnis <walter.mcgin...@gmail.com>
Date: Mon, 6 Jul 2009 18:52:53 +1200
Local: Mon, Jul 6 2009 2:52 am
Subject: Re: [WellRailed] Re: ActiveRecord Adapters

MongoMapper has some similar goals like being ActiveRecord-like, although
obviously aimed at MongoDB.
http://railstips.org/2009/6/27/mongomapper-the-rad-mongo-wrapper

I mention it for a place to get example code rather than something that will
do what you want.

It's from the previously mentioned and much admired John Nunkemaker,
too.  I would imagine it would have some fresher ideas than
ActiveResource as is it a brandnew piece of code.

All this might be for not.  Judging by your post to DigitalNZ list, you've
already done the work.

Cheers,
Walter

On Wed, Jul 1, 2009 at 2:42 PM, Henry Maddocks <henry.maddo...@gmail.com>wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henry Maddocks  
View profile  
 More options Jul 6, 5:28 am
From: Henry Maddocks <henry.maddo...@gmail.com>
Date: Mon, 6 Jul 2009 21:28:18 +1200
Local: Mon, Jul 6 2009 5:28 am
Subject: Re: [WellRailed] Re: ActiveRecord Adapters

On 6/07/2009, at 6:52 PM, Walter McGinnis wrote:

> MongoMapper has some similar goals like being ActiveRecord-like,  
> although obviously aimed at MongoDB.

Thanks, I'll take a look.

> All this might be for not.  Judging by your post to DigitalNZ list,  
> you've already done the work.

I've just done the basics. I'm leaving the fancy pants stuff for  
another day.

Henry


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google