Forum: Ruby RubyCocoa and ActiveRecord?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A049c3597983fdaaa2af2b0010c49abc?d=identicon&s=25 Tim Perrett (timperrett)
on 2007-03-23 11:38
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
3a83969376c805ef5b6042191fdb0ff3?d=identicon&s=25 Andreas S. (andreas)
on 2007-03-23 13:49
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.
A049c3597983fdaaa2af2b0010c49abc?d=identicon&s=25 Tim Perrett (timperrett)
on 2007-03-23 14:11
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!
Ebb3abd946f9da9dd304fcd4b9411c46?d=identicon&s=25 Eloy Duran (alloy)
on 2007-05-20 14:28
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?w...

Cheers,
Eloy
A049c3597983fdaaa2af2b0010c49abc?d=identicon&s=25 Tim Perrett (timperrett)
on 2007-05-21 19:07
Thanks Eloy, thats is a brilliant resource!
Ebb3abd946f9da9dd304fcd4b9411c46?d=identicon&s=25 Eloy Duran (alloy)
on 2007-05-21 19:51
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/GettingSupport

Cheers,
Eloy
This topic is locked and can not be replied to.