[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RubyCocoa and ActiveRecord?

Tim Perrett

3/23/2007 10:38:00 AM

Hey all

I have been contemplating if it is possible to use ActiveRecord in a
RubyCocoa application? Has anyone tried it? is it even possible?

All the best

Tim Perrett

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

5 Answers

Andreas S.

3/23/2007 12:49:00 PM

0

Tim Perrett wrote:
> I have been contemplating if it is possible to use ActiveRecord in a
> RubyCocoa application? Has anyone tried it? is it even possible?

Of course it's possible, ActiveRecord ist just a normal Ruby library.
You could even try to write an ActiveRecord database adapter for
CoreData.

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

Tim Perrett

3/23/2007 1:12:00 PM

0

Sounds sweet.

I see what you mean, i managed to get in there by doing a simple
require! should have thought of that.

One thing im not quite sure about however, is how would i then handle
that connection within the application? I obviously create my connection
with

ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "localhost",
:username => "myuser",
:password => "mypass",
:database => "somedatabase"
)

For instance, in rails, how is it that we can then call
SomeModel.find(:all) in our controller and it does not throw an error? I
know its to do with the load path, but does the same apply here?

Does it create a persistant connection to the database for the lifetime
of the application or do i need to call the connection from AR::Base
when i need it?

Cheers

Tim

PS: sorry if this seems like dull questions im just getting into the
RubyCocoa thing!

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

Eloy Duran

5/20/2007 12:29:00 PM

0

Hey Tim,

Just wanted to point you to the new RubyCocoa Wiki, which has some info
about the new ActiveRecord support in RubyCocoa.

http://rubycocoa.sourceforge.net/Wikka/wikka.php?wakka=ActiveRec...

Cheers,
Eloy

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

Tim Perrett

5/21/2007 5:08:00 PM

0

Thanks Eloy, thats is a brilliant resource!

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

Eloy Duran

5/21/2007 5:52:00 PM

0

Tim Perrett wrote:
> Thanks Eloy, thats is a brilliant resource!

Please do send any feedback to the rubycocoa-talk mailinglist.
http://rubycocoa.sourceforge.net/Wikka/Gett...

Cheers,
Eloy

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