Is there any reason why I can't use ActiveRecord to help build a client based app with FXRuby? If I'm understanding all this MVC stuff correctly, then I'd just be using the M bit in another app. Seems like it would save me a shed-load of work
True?
Graham
ActiveRecord is the ORM layer used by Rails, right? I don't think
there's any technical reason why this wouldn't work, although I don't
know that anyone's actually tried that yet. At any rate, I'd
appreciate hearing about your experience with it (especially if you
run into any conflicts between FXRuby and ActiveRecord).
···
On 10/3/05, Graham Foster <nowahere@home.com> wrote:
Is there any reason why I can't use ActiveRecord to help build a client
based app with FXRuby? If I'm understanding all this MVC stuff correctly,
then I'd just be using the M bit in another app. Seems like it would save
me a shed-load of work
True?
The Pragmatic RoR book explains in detail how to do this. It mostly just
involves passing in your DB config to ActiveRecord instead of having it in
the RoR ./config dir.
Someone please correct me if I've misspoken as I have not yet attempted
actually doing this.
The book's not in front of me right now, I'll try and paste an example later
after I check it out.
'njoy,
Mark
···
On 10/3/05 3:59 PM, "Lyle Johnson" <lyle.johnson@gmail.com> wrote:
On 10/3/05, Graham Foster <nowahere@home.com> wrote:
Is there any reason why I can't use ActiveRecord to help build a client
based app with FXRuby? If I'm understanding all this MVC stuff correctly,
then I'd just be using the M bit in another app. Seems like it would save
me a shed-load of work
True?ActiveRecord is the ORM layer used by Rails, right? I don't think
there's any technical reason why this wouldn't work, although I don't
know that anyone's actually tried that yet. At any rate, I'd
appreciate hearing about your experience with it (especially if you
run into any conflicts between FXRuby and ActiveRecord).
I've built a beer brewing helper in FXRuby/ActiveRecord with a SQLite
db to keep it all nice and file-y. No problems, no conflicts. Almost
got to the stage where I built scaffolding, before I remembered I was
building the program to help me brew beer, rather than brewing beer to
help me program.
···
On 10/4/05, Lyle Johnson <lyle.johnson@gmail.com> wrote:
On 10/3/05, Graham Foster <nowahere@home.com> wrote:
> Is there any reason why I can't use ActiveRecord to help build a client
> based app with FXRuby? If I'm understanding all this MVC stuff correctly,
> then I'd just be using the M bit in another app. Seems like it would save
> me a shed-load of work
> True?ActiveRecord is the ORM layer used by Rails, right? I don't think
there's any technical reason why this wouldn't work, although I don't
know that anyone's actually tried that yet. At any rate, I'd
appreciate hearing about your experience with it (especially if you
run into any conflicts between FXRuby and ActiveRecord).
--
David Naseby
http://homepages.ihug.com.au/~naseby/
Found my PDF version . . . Connect outside of Rails like so . . .
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "dbserver.com",
:database => "railsdb",
:username => "railsuser",
:password => "railspw"
)
Before you inherit or . . . The more clumsy . . .
class Customer < ActiveRecord::Base
# ...
end
Customer.establish_connection(
:adapter => "mysql",
:host => "dbserver.com",
:database => "backend",
:username => "chicho",
:password => "piano")
After you inherit version. Bear in mind that if you do it this way, you'll
likely need to connect for each model.
'njoy,
Mark
···
On 10/3/05 3:59 PM, "Lyle Johnson" <lyle.johnson@gmail.com> wrote:
On 10/3/05, Graham Foster <nowahere@home.com> wrote:
Is there any reason why I can't use ActiveRecord to help build a client
based app with FXRuby? If I'm understanding all this MVC stuff correctly,
then I'd just be using the M bit in another app. Seems like it would save
me a shed-load of work
True?ActiveRecord is the ORM layer used by Rails, right? I don't think
there's any technical reason why this wouldn't work, although I don't
know that anyone's actually tried that yet. At any rate, I'd
appreciate hearing about your experience with it (especially if you
run into any conflicts between FXRuby and ActiveRecord).
Well, I haven't used ActiveRecord as part of another GUI interface, but I
have been playing with it lately as a seperate component to rails. The
scripts I have are just using AR to populate a database and run some simple
queries. None-the-less it has been a real time saver.
As the paremnt post mentions, just use ActiveRecord::
Base.establish_connection, rather than updating the configuration in
database.yml. The name parameters are the same as the keys in the yaml file.
···
--
Lou
On 10/3/05, Mark Cotner <mcotner@yahoo.com> wrote:
The Pragmatic RoR book explains in detail how to do this. It mostly just
involves passing in your DB config to ActiveRecord instead of having it in
the RoR ./config dir.Someone please correct me if I've misspoken as I have not yet attempted
actually doing this.The book's not in front of me right now, I'll try and paste an example
later
after I check it out.'njoy,
MarkOn 10/3/05 3:59 PM, "Lyle Johnson" <lyle.johnson@gmail.com> wrote:
> On 10/3/05, Graham Foster <nowahere@home.com> wrote:
>
>> Is there any reason why I can't use ActiveRecord to help build a client
>> based app with FXRuby? If I'm understanding all this MVC stuff
correctly,
>> then I'd just be using the M bit in another app. Seems like it would
save
>> me a shed-load of work
>> True?
>
> ActiveRecord is the ORM layer used by Rails, right? I don't think
> there's any technical reason why this wouldn't work, although I don't
> know that anyone's actually tried that yet. At any rate, I'd
> appreciate hearing about your experience with it (especially if you
> run into any conflicts between FXRuby and ActiveRecord).
>
The Pragmatic RoR book explains in detail how to do this. It mostly just
involves passing in your DB config to ActiveRecord instead of having it in
the RoR ./config dir.Someone please correct me if I've misspoken as I have not yet attempted
actually doing this.
Nope, you're exactly right, Mark.
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:host => "localhost",
:username => "me",
:password => "password"
)
And then define your classes and away you go. It's pretty straightforward.
- Jamis
···
On Oct 3, 2005, at 2:50 PM, Mark Cotner wrote:
The book's not in front of me right now, I'll try and paste an example later
after I check it out.'njoy,
MarkOn 10/3/05 3:59 PM, "Lyle Johnson" <lyle.johnson@gmail.com> wrote:
On 10/3/05, Graham Foster <nowahere@home.com> wrote:
Is there any reason why I can't use ActiveRecord to help build a client
based app with FXRuby? If I'm understanding all this MVC stuff correctly,
then I'd just be using the M bit in another app. Seems like it would save
me a shed-load of work
True?ActiveRecord is the ORM layer used by Rails, right? I don't think
there's any technical reason why this wouldn't work, although I don't
know that anyone's actually tried that yet. At any rate, I'd
appreciate hearing about your experience with it (especially if you
run into any conflicts between FXRuby and ActiveRecord).
Brewing (and subsequently drinking) beer to help you (or me) program should
not be summarily rejected. ![]()
Randy Kramer
···
On Monday 03 October 2005 05:01 pm, David Naseby wrote:
I've built a beer brewing helper in FXRuby/ActiveRecord with a SQLite
db to keep it all nice and file-y. No problems, no conflicts. Almost
got to the stage where I built scaffolding, before I remembered I was
building the program to help me brew beer, rather than brewing beer to
help me program.
Thanks for the pointers. I'd better get started ![]()
···
On Mon, 03 Oct 2005 22:01:22 +0100, Louis J Scoras <louis.j.scoras@gmail.com> wrote:
As the paremnt post mentions, just use ActiveRecord::
Base.establish_connection, rather than updating the configuration in
database.yml. The name parameters are the same as the keys in the yaml file