From pelargir at gmail.com Thu Mar 1 09:33:39 2007 From: pelargir at gmail.com (Matthew) Date: Thu, 1 Mar 2007 09:33:39 -0500 Subject: [raleigh.rb] Backgroundrb with Mocha Message-ID: Has anyone successfully used the Backgroundrb and Mocha Rails plugins together? I keep getting error messages like this when I run my tests with both plugins installed. If I move Backgroundrb out of vendor/plugins, the errors go away: test_time_left(Exchange::ExaminationHelperTest): NoMethodError: undefined method `stubs' for # method method_missing in test_process.rb at line 452 method setup_without_fixtures in examination_helper_test.rb at line 10 method setup in fixtures.rb at line 564 test_post_suspended_with_certified_member(Exchange::LoginControllerTest): NoMethodError: undefined method `any_instance' for Payment::SkipJack:Class method setup_without_fixtures in login_controller_test.rb at line 18 method setup in fixtures.rb at line 564 Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070301/a0374842/attachment.html From mark.bennett.mail at gmail.com Tue Mar 6 12:01:23 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Tue, 6 Mar 2007 12:01:23 -0500 Subject: [raleigh.rb] ruby Message-ID: While writing some test code I found out what is great about ruby: puts people[:first] Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070306/08a67f7e/attachment.html From rick.denatale at gmail.com Tue Mar 6 13:48:23 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 6 Mar 2007 13:48:23 -0500 Subject: [raleigh.rb] Installing multiple versions of ruby correctly. Message-ID: I'm trying to straighten out having multiple versions of ruby installed on the same ubuntu/debian machine. Lets say I want to have ruby1.9, ruby1.8.5 and ruby1.8.6 all installed so as not to interfere with each other. I'm installing from source, and I'm looking for the right configure options to use. Right now I'm specifying --program-suffix=1.8.5 and --program-suffix=1.8.6 for the two different 1.8.x versions, but when I make and install then try to run typo using 1.8.5 it complains that it's finding the 1.8.6 version of the libraries. I think that what I want to do is to put the 1.8.6 libraries under /usr/local/lib/ruby/1.8.6 and the 1.8.5 under /usr/local/lib/ruby/1.8.5 but I'm not sure which configure options to use. I also notice that I've got a /usr/local/lib/site-ruby with a 1.8 subdirectory, and /usr/local/lib/ruby ALSO has a site-ruby directory with 1.8 and 1.9 directories. I'm not sure just how I got there, nor what the standard layout in my situation should be. I'm also wondering if there's a way to find out what would happen during an install with out actually running it. Normally you'd do make -n install to force a dry run, but the ruby install uses instruby.rb which actually does the install, so all you see is that it would run that with no indication of where the files would actually go. There is also a /usr/lib/ruby directory which contains the libraries for the ubuntu packaged (1.8.4) which I don't want to remove since some other packages depend on this. Any advice/help appreciated. -- Rick From kevin.olbrich at gmail.com Wed Mar 7 09:15:37 2007 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Wed, 7 Mar 2007 09:15:37 -0500 Subject: [raleigh.rb] Near-Time is hiring Message-ID: For those of you who may be looking for a full-time Rails development gig in RTP, Near-Time is hiring. If you are interested, and have some Rails development experience, drop me a line. Javascript skills are a bonus. --- Kevin Olbrich kevin at near-time.com www.near-time.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070307/48d9be17/attachment.html From lists-jared at nc.rr.com Wed Mar 7 10:13:59 2007 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 7 Mar 2007 10:13:59 -0500 Subject: [raleigh.rb] Agile RTP In-Reply-To: References: Message-ID: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> Hi all, We're trying to see if a local Agile group would work here in RTP, so here goes! Please let me know if you're coming so Frankie's can schedule extra waiters/waitresses as needed. -------------------------- http://agileartisans.com/artp/ Agile RTP (ARTp) Are you a fan of the Manifesto for Agile Software Development and in the RTP area? If so, come out and join us on our first meeting. Thursday, March 22nd we'll get together at Frankie's (near Briar Creek) and have a combination kick-off meeting and also a shared event with the agile-carolinas group in Charlotte. Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies of Test Driven Development and we'll participate via a video chat system. In the future, I'd like to have on site speakers, but this event gave us a deadline to get started, so let get rolling. When? March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room from 6:30 to 8:00. That's their time limit on a free room. However, if we happen to show up earlier and order food (say, at 6 pm), I think we'll be fine. What? We'll be listening to Dr. Larie William's Agile Carolina's meeting via a video link. Dr. Williams will be speaking on Test Driven Development. I'm told we'll be able to interact and ask questions, but if we heckle, they'll mute us. -------------------------- Jared http://JaredRichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070307/0bd40557/attachment.html From blake at near-time.com Wed Mar 7 15:30:38 2007 From: blake at near-time.com (Blake Watters) Date: Wed, 7 Mar 2007 15:30:38 -0500 Subject: [raleigh.rb] Agile RTP In-Reply-To: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> References: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> Message-ID: <48CAD206-F452-40E1-947A-AC894B0DDCE5@near-time.com> In. On Mar 7, 2007, at 10:13 AM, Jared Richardson wrote: > Hi all, > > We're trying to see if a local Agile group would work here in RTP, > so here goes! Please let me know if you're coming so Frankie's can > schedule extra waiters/waitresses as needed. > > > -------------------------- > > http://agileartisans.com/artp/ > > Agile RTP (ARTp) > > Are you a fan of the Manifesto for Agile Software Development and > in the RTP area? If so, come out and join us on our first meeting. > Thursday, March 22nd we'll get together at Frankie's (near Briar > Creek) and have a combination kick-off meeting and also a shared > event with the agile-carolinas group in Charlotte. > > Dr. Laurie Williams will be speaking in Charlotte on Empirical > Studies of Test Driven Development and we'll participate via a > video chat system. > > In the future, I'd like to have on site speakers, but this event > gave us a deadline to get started, so let get rolling. > > When? > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the > room from 6:30 to 8:00. That's their time limit on a free room. > However, if we happen to show up earlier and order food (say, at 6 > pm), I think we'll be fine. > > What? > We'll be listening to Dr. Larie William's Agile Carolina's meeting > via a video link. Dr. Williams will be speaking on Test Driven > Development. I'm told we'll be able to interact and ask questions, > but if we heckle, they'll mute us. > > -------------------------- > > Jared > http://JaredRichardson.net > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > !DSPAM:2,45eed372215465991368296! !DSPAM:57,45ef1a90246042561410489! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070307/c7ee5472/attachment-0001.html From pelargir at gmail.com Wed Mar 7 21:33:26 2007 From: pelargir at gmail.com (Matthew) Date: Wed, 7 Mar 2007 21:33:26 -0500 Subject: [raleigh.rb] Agile RTP In-Reply-To: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> References: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> Message-ID: Definitely in. Matthew On 3/7/07, Jared Richardson wrote: > > Hi all, > > We're trying to see if a local Agile group would work here in RTP, so here > goes! Please let me know if you're coming so Frankie's can schedule extra > waiters/waitresses as needed. > > > -------------------------- > > http://agileartisans.com/artp/ > > Agile RTP (ARTp) > > Are you a fan of the Manifesto for Agile Software Development and in the > RTP area? If so, come out and join us on our first meeting. Thursday, March > 22nd we'll get together at Frankie's (near Briar Creek) and have a > combination kick-off meeting and also a shared event with the > agile-carolinas group in Charlotte. > > Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies of > Test Driven Development and we'll participate via a video chat system. > > In the future, I'd like to have on site speakers, but this event gave us a > deadline to get started, so let get rolling. > > When? > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room from > 6:30 to 8:00. That's their time limit on a free room. However, if we happen > to show up earlier and order food (say, at 6 pm), I think we'll be fine. > > What? > We'll be listening to Dr. Larie William's Agile Carolina's meeting via a > video link. Dr. Williams will be speaking on Test Driven Development. I'm > told we'll be able to interact and ask questions, but if we heckle, they'll > mute us. > > -------------------------- > > Jared > http://JaredRichardson.net > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070307/f2edbf96/attachment.html From nospam at tonyspencer.com Thu Mar 8 11:03:16 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 8 Mar 2007 11:03:16 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb Message-ID: Hi, I am rebuilding a local site I started years ago in Rails. I'd really like to keep the URL structure the same if possible and I don't know how to do this with routes. For instance, is it possible for me to create a route for the model 'city' that will have a URL like this? I can make the slug 'cary-movie-theater-listings' in the DB but how do I tack on the ".htm"? http://movies.raleighlist.org/cary-movie-theater-listings.htm From geoff at geoffdavis.net Thu Mar 8 11:59:35 2007 From: geoff at geoffdavis.net (Geoff Davis) Date: Thu, 8 Mar 2007 11:59:35 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: References: Message-ID: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> You could use mod_rewrite in Apache to strip off the .htm before handing off to Rails. On Mar 8, 2007, at 11:03 AM, Tony Spencer wrote: > Hi, > I am rebuilding a local site I started years ago in Rails. I'd > really like to keep the URL structure the same if possible and I > don't know how to do this with routes. For instance, is it possible > for me to create a route for the model 'city' that will have a URL > like this? I can make the slug 'cary-movie-theater-listings' in the > DB but how do I tack on the ".htm"? > > http://movies.raleighlist.org/cary-movie-theater-listings.htm > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From rick.denatale at gmail.com Thu Mar 8 13:10:36 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 8 Mar 2007 13:10:36 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: References: Message-ID: On 3/8/07, Tony Spencer wrote: > Hi, > I am rebuilding a local site I started years ago in Rails. I'd > really like to keep the URL structure the same if possible and I > don't know how to do this with routes. For instance, is it possible > for me to create a route for the model 'city' that will have a URL > like this? I can make the slug 'cary-movie-theater-listings' in the > DB but how do I tack on the ".htm"? > > http://movies.raleighlist.org/cary-movie-theater-listings.htm Is your concern only letting people access your site with those old style urls? If so, and if you are running behind a web server like Apache, why not rewrite the incoming urls using the mod_rewrite or the like and just strip of the .htm? So that the rails app sees either cary-movie-theater-listings.htm or cary-movie-theater-listings as the latter. --- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From nospam at tonyspencer.com Thu Mar 8 13:29:39 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 8 Mar 2007 13:29:39 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> References: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> Message-ID: Yeah that is my last resort but that means I'd have to develop with Apache and I was really hoping to never have to touch mod_rewrite again. :) On Mar 8, 2007, at 11:59 AM, Geoff Davis wrote: > You could use mod_rewrite in Apache to strip off the .htm before > handing off to Rails. > > On Mar 8, 2007, at 11:03 AM, Tony Spencer wrote: > >> Hi, >> I am rebuilding a local site I started years ago in Rails. I'd >> really like to keep the URL structure the same if possible and I >> don't know how to do this with routes. For instance, is it possible >> for me to create a route for the model 'city' that will have a URL >> like this? I can make the slug 'cary-movie-theater-listings' in the >> DB but how do I tack on the ".htm"? >> >> http://movies.raleighlist.org/cary-movie-theater-listings.htm >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nospam at tonyspencer.com Thu Mar 8 13:36:11 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 8 Mar 2007 13:36:11 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: References: Message-ID: I'm more concerned with the authority those old URL's have in the eyes of Google and other search engines. I think I may just make it easier on myself and use mod_rewrite to 301 redirect the old url's to something more Rails friendly. I was just hoping to somehow maintain them via named routes. On Mar 8, 2007, at 1:10 PM, Rick DeNatale wrote: > On 3/8/07, Tony Spencer wrote: >> Hi, >> I am rebuilding a local site I started years ago in Rails. I'd >> really like to keep the URL structure the same if possible and I >> don't know how to do this with routes. For instance, is it possible >> for me to create a route for the model 'city' that will have a URL >> like this? I can make the slug 'cary-movie-theater-listings' in the >> DB but how do I tack on the ".htm"? >> >> http://movies.raleighlist.org/cary-movie-theater-listings.htm > > Is your concern only letting people access your site with those old > style urls? > > If so, and if you are running behind a web server like Apache, why not > rewrite the incoming urls using the mod_rewrite or the like and just > strip of the .htm? So that the rails app sees either > cary-movie-theater-listings.htm > or > cary-movie-theater-listings > as the latter. > --- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From pelargir at gmail.com Thu Mar 8 14:36:03 2007 From: pelargir at gmail.com (Matthew) Date: Thu, 8 Mar 2007 14:36:03 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: References: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> Message-ID: When I converted one of my PHP apps to Rails, I was able to route the old pages like so: map.connect 'contactUs.php', :controller => 'site', :action => 'contact_us' map.connect 'donations.php', :controller => 'site', :action => 'donate' map.connect 'faq.php', :controller => 'site', :action => 'faq' map.connect 'media.php', :controller => 'site', :action => 'in_the_news' map.connect 'mission.php', :controller => 'site', :action => 'mission' map.connect 'values.php', :controller => 'site', :action => 'mission' map.connect ':file', :controller => 'site', :requirements => { :file => /^.+\.php$/ } However, this was under Rails 1.1.6. With the new support for route extensions in 1.2.2 you may have trouble getting this to work. Looking back, I probably should have opted for mod_rewrite here. It seems kludgy to have my pristine Rails app know anything about the old PHP pages that used to be there. Matthew On 3/8/07, Tony Spencer wrote: > > Yeah that is my last resort but that means I'd have to develop with > Apache and I was really hoping to never have to touch mod_rewrite > again. :) > > On Mar 8, 2007, at 11:59 AM, Geoff Davis wrote: > > > You could use mod_rewrite in Apache to strip off the .htm before > > handing off to Rails. > > > > On Mar 8, 2007, at 11:03 AM, Tony Spencer wrote: > > > >> Hi, > >> I am rebuilding a local site I started years ago in Rails. I'd > >> really like to keep the URL structure the same if possible and I > >> don't know how to do this with routes. For instance, is it possible > >> for me to create a route for the model 'city' that will have a URL > >> like this? I can make the slug 'cary-movie-theater-listings' in the > >> DB but how do I tack on the ".htm"? > >> > >> http://movies.raleighlist.org/cary-movie-theater-listings.htm > >> _______________________________________________ > >> raleigh-rb-members mailing list > >> raleigh-rb-members at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > >> > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070308/b03f299f/attachment-0001.html From geoff at geoffdavis.net Thu Mar 8 14:36:55 2007 From: geoff at geoffdavis.net (Geoff Davis) Date: Thu, 8 Mar 2007 14:36:55 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: References: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> Message-ID: <90B38D83-9256-4A94-B205-0D7854F12FDE@geoffdavis.net> mod_rewrite builds character! On Mar 8, 2007, at 1:29 PM, Tony Spencer wrote: > Yeah that is my last resort but that means I'd have to develop with > Apache and I was really hoping to never have to touch mod_rewrite > again. :) > From nospam at tonyspencer.com Thu Mar 8 15:16:57 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 8 Mar 2007 15:16:57 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: <90B38D83-9256-4A94-B205-0D7854F12FDE@geoffdavis.net> References: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> <90B38D83-9256-4A94-B205-0D7854F12FDE@geoffdavis.net> Message-ID: <1E8190F5-FA0F-4BDE-9E23-59B7661E3C1A@tonyspencer.com> Hehhehe. Yeah you can't help but not love mod_rewrite. The reason I want to get away from it is that unlike Matthew, I'd rather see all info about my old PHP page in my app. This means that if ever I move my Rails app to another host I don't have to concern myself with a .htaccess file that would be so easy to overlook. If you were to overlook it and suddenly all your old 301 redirects are now returning 404 it can wreak havoc on your rankings in the search engines. But I guess I'll just have to accept that .htaccess rewrite rules will be with me for a long time. :( On Mar 8, 2007, at 2:36 PM, Geoff Davis wrote: > mod_rewrite builds character! > > On Mar 8, 2007, at 1:29 PM, Tony Spencer wrote: > >> Yeah that is my last resort but that means I'd have to develop with >> Apache and I was really hoping to never have to touch mod_rewrite >> again. :) >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nospam at tonyspencer.com Thu Mar 8 15:18:40 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 8 Mar 2007 15:18:40 -0500 Subject: [raleigh.rb] Maintaining old .htm URL's with routes.rb In-Reply-To: <90B38D83-9256-4A94-B205-0D7854F12FDE@geoffdavis.net> References: <488C2578-C31B-424C-A717-660AF8BC3154@geoffdavis.net> <90B38D83-9256-4A94-B205-0D7854F12FDE@geoffdavis.net> Message-ID: Sorry, I meant to say "you can't help but LOVE mod_rewrite". I certainly do. http://www.seobook.com/archives/001714.shtml On Mar 8, 2007, at 2:36 PM, Geoff Davis wrote: > mod_rewrite builds character! > > On Mar 8, 2007, at 1:29 PM, Tony Spencer wrote: > >> Yeah that is my last resort but that means I'd have to develop with >> Apache and I was really hoping to never have to touch mod_rewrite >> again. :) >> > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nathaniel at talbott.ws Fri Mar 9 14:20:39 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 9 Mar 2007 14:20:39 -0500 Subject: [raleigh.rb] Installing multiple versions of ruby correctly. In-Reply-To: References: Message-ID: <5B9F234F-7FD5-4BCB-AE61-6BA80A33126B@talbott.ws> On Mar 6, 2007, at 13:48 , Rick DeNatale wrote: > I'm trying to straighten out having multiple versions of ruby > installed on the same ubuntu/debian machine. > > Lets say I want to have ruby1.9, ruby1.8.5 and ruby1.8.6 all installed > so as not to interfere with each other. > > I'm installing from source, and I'm looking for the right configure > options to use. One thing that could help is multiruby, which is part of the ZenTest gem: http://www.zenspider.com/ZSS/Products/ZenTest/ I haven't used it, but it looks like it handles the whole shebang for you. If nothing else, you should be able to peruse the code and figure out how they're isolating the various Ruby versions. HTH, -- Nathaniel Talbott <:((>< From ruby at bandkbroom.com Sat Mar 10 00:36:02 2007 From: ruby at bandkbroom.com (Brian Broom) Date: Sat, 10 Mar 2007 00:36:02 -0500 Subject: [raleigh.rb] Ruby extension in C (part 2) In-Reply-To: <45D14E05.6050806@bandkbroom.com> References: <49416E81-71F6-4549-A03C-C2E21365B80E@talbott.ws> <45D10F73.2060001@bandkbroom.com> <45D14E05.6050806@bandkbroom.com> Message-ID: <45F243C2.7070007@bandkbroom.com> I've written up some more of my notes on C extensions. I've done a fair bit of this on some real code in the past few weeks and didn't find a ton of examples when I started looking into it. http://www.bandkbroom.com/blog/2007/03/10/RubyExtensionsInCPartII.aspx Brian From ryan.a.cox at gmail.com Tue Mar 13 08:07:30 2007 From: ryan.a.cox at gmail.com (Ryan Cox) Date: Tue, 13 Mar 2007 07:07:30 -0500 Subject: [raleigh.rb] Google Video: Competitious On Rails Message-ID: FWIW: Here's a link to to a recent Google TechTalk: RUBY: Competitious On Rails. Even putting the RoR angle aside, it's an interesting behind the scenes look at deploying a site and getting TechCrunch'd. http://video.google.com/videoplay?docid=-298048302833678800 -ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070313/5c71c1c3/attachment.html From nospam at tonyspencer.com Wed Mar 14 15:48:26 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Wed, 14 Mar 2007 15:48:26 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? Message-ID: Rails migrations and SVN can be a problem. If I create a migration 20-create-users-table.rb and at the same time a team member creates a migration 20-add-column-to-address.rb then one of us is going to have to do a bit of work to change his migration version number before committing. Does anybody have a good solution for dealing with this? Tony Spencer From mark.bennett.mail at gmail.com Wed Mar 14 15:55:22 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Wed, 14 Mar 2007 15:55:22 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: References: Message-ID: Commit an empty stub right off the bat. Perhaps? Mark On 3/14/07, Tony Spencer wrote: > > Rails migrations and SVN can be a problem. If I create a migration > 20-create-users-table.rb and at the same time a team member creates a > migration 20-add-column-to-address.rb then one of us is going to have > to do a bit of work to change his migration version number before > committing. Does anybody have a good solution for dealing with this? > > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070314/9d082058/attachment.html From pelargir at gmail.com Wed Mar 14 15:58:48 2007 From: pelargir at gmail.com (Matthew) Date: Wed, 14 Mar 2007 15:58:48 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: References: Message-ID: I've run into this several times on a project I'm currently working on. I haven't heard of (or found) a good solution other than communicating with the other developers when a migration is checked in, or dubbing one developer on the team the "migration guy" and making schema changes through him. When I do have a collision, the easiest thing to do is rollback to the version number just before the conflicting migration, rename one of the migrations to a later version number, and then migrate forward again. Of course, this would have to be done on any deployments that had already applied one of the conflicting migrations. Matthew On 3/14/07, Tony Spencer wrote: > > Rails migrations and SVN can be a problem. If I create a migration > 20-create-users-table.rb and at the same time a team member creates a > migration 20-add-column-to-address.rb then one of us is going to have > to do a bit of work to change his migration version number before > committing. Does anybody have a good solution for dealing with this? > > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070314/077dd067/attachment.html From kevin.olbrich at gmail.com Wed Mar 14 16:09:56 2007 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Wed, 14 Mar 2007 16:09:56 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: References: Message-ID: http://revolutiononrails.blogspot.com/2007/02/plugin-release-enhanced-rails.html Take a look at this. _Kevin On 3/14/07, Mark Bennett wrote: > > Commit an empty stub right off the bat. Perhaps? > > Mark > > On 3/14/07, Tony Spencer wrote: > > > > Rails migrations and SVN can be a problem. If I create a migration > > 20-create-users-table.rb and at the same time a team member creates a > > migration 20-add-column-to-address.rb then one of us is going to have > > to do a bit of work to change his migration version number before > > committing. Does anybody have a good solution for dealing with this? > > > > Tony Spencer > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070314/46ac9b4e/attachment-0001.html From nospam at tonyspencer.com Wed Mar 14 16:10:16 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Wed, 14 Mar 2007 16:10:16 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: References: Message-ID: Thanks for the tip. That sounds like an easy enough conflict resolution. For some reason I thought that didn't work for me before but I'll try it next time. On Mar 14, 2007, at 3:58 PM, Matthew wrote: > I've run into this several times on a project I'm currently working > on. I haven't heard of (or found) a good solution other than > communicating with the other developers when a migration is checked > in, or dubbing one developer on the team the "migration guy" and > making schema changes through him. > > When I do have a collision, the easiest thing to do is rollback to > the version number just before the conflicting migration, rename > one of the migrations to a later version number, and then migrate > forward again. Of course, this would have to be done on any > deployments that had already applied one of the conflicting > migrations. > > Matthew > > > On 3/14/07, Tony Spencer wrote: > Rails migrations and SVN can be a problem. If I create a migration > 20-create-users-table.rb and at the same time a team member creates a > migration 20-add-column-to-address.rb then one of us is going to have > to do a bit of work to change his migration version number before > committing. Does anybody have a good solution for dealing with this? > > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070314/0fd660e3/attachment.html From nathaniel at talbott.ws Wed Mar 14 16:11:05 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Wed, 14 Mar 2007 16:11:05 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: References: Message-ID: <2A3A99A1-F786-4C76-86ED-9CA1603FB620@talbott.ws> On Mar 14, 2007, at 15:48 , Tony Spencer wrote: > Rails migrations and SVN can be a problem. If I create a migration > 20-create-users-table.rb and at the same time a team member creates a > migration 20-add-column-to-address.rb then one of us is going to have > to do a bit of work to change his migration version number before > committing. Does anybody have a good solution for dealing with this? This might help: http://revolutiononrails.blogspot.com/2007/01/db-migrations-usage- at-rhg.html -- Nathaniel Talbott <:((>< From ryan.daigle at gmail.com Wed Mar 14 16:32:27 2007 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 14 Mar 2007 16:32:27 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: References: Message-ID: <748ff3ff0703141332tb9e347bi45ca7f70591f2761@mail.gmail.com> By always updating before you commit you can spot these issues before both get committed. Of course this does take a little developer awareness that you may or may not have luxury of. On 3/14/07, Tony Spencer wrote: > Rails migrations and SVN can be a problem. If I create a migration > 20-create-users-table.rb and at the same time a team member creates a > migration 20-add-column-to-address.rb then one of us is going to have > to do a bit of work to change his migration version number before > committing. Does anybody have a good solution for dealing with this? > > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From blake at near-time.com Wed Mar 14 16:53:41 2007 From: blake at near-time.com (Blake Watters) Date: Wed, 14 Mar 2007 16:53:41 -0400 Subject: [raleigh.rb] How do you handle migrations and SVN? In-Reply-To: <748ff3ff0703141332tb9e347bi45ca7f70591f2761@mail.gmail.com> References: <748ff3ff0703141332tb9e347bi45ca7f70591f2761@mail.gmail.com> Message-ID: If you are doing branching or plan to start some day, I'd highly recommend the Enhanced Migrations plugin. It uses a timestamped numbering scheme that removes the possibility of conflicts entirely... No amount of communication is going to help you in a branched environment and its a real time sink to be constantly shuffling migration numbers because of parallel development efforts. On Mar 14, 2007, at 4:32 PM, Ryan Daigle wrote: > By always updating before you commit you can spot these issues before > both get committed. > > Of course this does take a little developer awareness that you may or > may not have luxury of. > > On 3/14/07, Tony Spencer wrote: >> Rails migrations and SVN can be a problem. If I create a migration >> 20-create-users-table.rb and at the same time a team member creates a >> migration 20-add-column-to-address.rb then one of us is going to have >> to do a bit of work to change his migration version number before >> committing. Does anybody have a good solution for dealing with this? >> >> Tony Spencer >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > !DSPAM:57,45f860cc144643357861022! From nospam at tonyspencer.com Wed Mar 14 18:13:15 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Wed, 14 Mar 2007 18:13:15 -0400 Subject: [raleigh.rb] Where to place common code for both controllers and views? Message-ID: I'm repeating myself in code so I know I'm not doing this the correct way. Where do you place a code block that needs to be accessed by both controllers and views? Currently I am checking for the current logged in user by duplicating this code block in both the user controller and user helper: def current_user if session[:user_id] User.find(session[:user_id]) else nil end end From ryan.daigle at gmail.com Wed Mar 14 19:38:28 2007 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 14 Mar 2007 19:38:28 -0400 Subject: [raleigh.rb] Where to place common code for both controllers and views? In-Reply-To: References: Message-ID: <748ff3ff0703141638s4eac46abvf002b8f28793078@mail.gmail.com> You can define your method once in your controller and make it available to your views with: helper :current_user -Ryan On 3/14/07, Tony Spencer wrote: > > I'm repeating myself in code so I know I'm not doing this the correct > way. Where do you place a code block that needs to be accessed by > both controllers and views? Currently I am checking for the current > logged in user by duplicating this code block in both the user > controller and user helper: > > def current_user > if session[:user_id] > User.find(session[:user_id]) > else > nil > end > end > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070314/ec3fe7b6/attachment.html From blake at near-time.com Wed Mar 14 20:06:42 2007 From: blake at near-time.com (Blake Watters) Date: Wed, 14 Mar 2007 20:06:42 -0400 Subject: [raleigh.rb] Where to place common code for both controllers and views? In-Reply-To: References: Message-ID: You might want to consider putting your "current user" concept up into the model. class User < ActiveRecord::Base cattr_accessor :current_user end Then high up in your controller before_filter chain just do User.current_user = User.find_by_id(session[:user_id]) Then User.current_user is available throughout the application. Something else to consider is using an "Anonymous User" that is the current user for non-logged in users. Then you don't have to worry about hitting a nil every time you want to reference some property of current user. On Mar 14, 2007, at 6:13 PM, Tony Spencer wrote: > I'm repeating myself in code so I know I'm not doing this the correct > way. Where do you place a code block that needs to be accessed by > both controllers and views? Currently I am checking for the current > logged in user by duplicating this code block in both the user > controller and user helper: > > def current_user > if session[:user_id] > User.find(session[:user_id]) > else > nil > end > end > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > !DSPAM:57,45f88e19163161296043353! From mark.bennett.mail at gmail.com Thu Mar 15 16:35:58 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 15 Mar 2007 16:35:58 -0400 Subject: [raleigh.rb] [Juglist] Agile RTP In-Reply-To: <03314C3E-00A8-4DCF-B189-E817F0F23606@nc.rr.com> References: <45E8DEC5.2020702@RTMX.net> <03314C3E-00A8-4DCF-B189-E817F0F23606@nc.rr.com> Message-ID: Jared, This sounds great, but I was just looking a the calendar and next week is pretty packed. There's trijug, raleigh.rb, and agilertp all in the same week. Can you have too much of a good thing? I wonder if it may be worth talking about whether to compete with these meetings in the same week. I appreciate the work it takes to get these events going. Thanks. Mark On 3/7/07, Jared Richardson wrote: > > Hi all, > > We're trying to see if a local Agile group would work here in RTP, so here > goes! Please let me know if plan to attend so Frankie's can schedule extra > waiters/waitresses as needed. > > > -------------------------- > > http://agileartisans.com/artp/ > > Agile RTP (ARTp) > > Are you a fan of the Manifesto for Agile Software Development and in the > RTP area? If so, come out and join us on our first meeting. Thursday, March > 22nd we'll get together at Frankie's (near Briar Creek) and have a > combination kick-off meeting and also a shared event with the > agile-carolinas group in Charlotte. > > Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies of > Test Driven Development and we'll participate via a video chat system. > > In the future, I'd like to have on site speakers, but this event gave us a > deadline to get started, so let get rolling. > > When? > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room from > 6:30 to 8:00. That's their time limit on a free room. However, if we happen > to show up earlier and order food (say, at 6 pm), I think we'll be fine. > > What? > We'll be listening to Dr. Larie William's Agile Carolina's meeting via a > video link. Dr. Williams will be speaking on Test Driven Development. I'm > told we'll be able to interact and ask questions, but if we heckle, they'll > mute us. > > -------------------------- > > Jared > http://JaredRichardson.net > > > > _______________________________________________ > Juglist mailing list > Juglist at trijug.org > http://trijug.org/mailman/listinfo/juglist_trijug.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070315/154180f2/attachment-0001.html From pelargir at gmail.com Thu Mar 15 16:43:10 2007 From: pelargir at gmail.com (Matthew) Date: Thu, 15 Mar 2007 16:43:10 -0400 Subject: [raleigh.rb] [Juglist] Agile RTP In-Reply-To: References: <45E8DEC5.2020702@RTMX.net> <03314C3E-00A8-4DCF-B189-E817F0F23606@nc.rr.com> Message-ID: The more the merrier as far as I'm concerned. But I'm still single. And I work from home. Those two things may have something to do with it. =) Seriously, I understand that most folks already have packed schedules. I, for one, am not opposed to a date switcheroo if Jared so legislates. Matthew On 3/15/07, Mark Bennett wrote: > > Jared, > > This sounds great, but I was just looking a the calendar and next week is > pretty packed. There's trijug, raleigh.rb, and agilertp all in the same > week. Can you have too much of a good thing? I wonder if it may be worth > talking about whether to compete with these meetings in the same week. I > appreciate the work it takes to get these events going. Thanks. > > Mark > > On 3/7/07, Jared Richardson wrote: > > > > Hi all, > > > > We're trying to see if a local Agile group would work here in RTP, so > > here goes! Please let me know if plan to attend so Frankie's can schedule > > extra waiters/waitresses as needed. > > > > > > -------------------------- > > > > http://agileartisans.com/artp/ > > > > Agile RTP (ARTp) > > > > Are you a fan of the Manifesto for Agile Software Development and in the > > RTP area? If so, come out and join us on our first meeting. Thursday, March > > 22nd we'll get together at Frankie's (near Briar Creek) and have a > > combination kick-off meeting and also a shared event with the > > agile-carolinas group in Charlotte. > > > > Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies > > of Test Driven Development and we'll participate via a video chat system. > > > > In the future, I'd like to have on site speakers, but this event gave us > > a deadline to get started, so let get rolling. > > > > When? > > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room > > from 6:30 to 8:00. That's their time limit on a free room. However, if we > > happen to show up earlier and order food (say, at 6 pm), I think we'll be > > fine. > > > > What? > > We'll be listening to Dr. Larie William's Agile Carolina's meeting via a > > video link. Dr. Williams will be speaking on Test Driven Development. I'm > > told we'll be able to interact and ask questions, but if we heckle, they'll > > mute us. > > > > -------------------------- > > > > Jared > > http://JaredRichardson.net > > > > > > > > _______________________________________________ > > Juglist mailing list > > Juglist at trijug.org > > http://trijug.org/mailman/listinfo/juglist_trijug.org > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070315/26b3dcfd/attachment.html From lists-jared at nc.rr.com Thu Mar 15 17:56:04 2007 From: lists-jared at nc.rr.com (Jared Richardson) Date: Thu, 15 Mar 2007 17:56:04 -0400 Subject: [raleigh.rb] [Juglist] Agile RTP In-Reply-To: References: <45E8DEC5.2020702@RTMX.net> <03314C3E-00A8-4DCF-B189-E817F0F23606@nc.rr.com> Message-ID: <58AF9CE2-877B-4020-8E7E-55F5C5A78FEB@nc.rr.com> We've having it next week to take advantage of Dr. William's presentation at the Agile Charlotte group, but I'd like to avoid competing or crowding with other groups as much as we can. Life is busy enough. :) Jared http://JaredRichardson.net On Mar 15, 2007, at 4:43 PM |Mar/15, Matthew wrote: > The more the merrier as far as I'm concerned. But I'm still single. > And I work from home. Those two things may have something to do > with it. =) > > Seriously, I understand that most folks already have packed > schedules. I, for one, am not opposed to a date switcheroo if Jared > so legislates. > > Matthew > > > On 3/15/07, Mark Bennett wrote: > Jared, > > This sounds great, but I was just looking a the calendar and next > week is pretty packed. There's trijug, raleigh.rb, and agilertp > all in the same week. Can you have too much of a good thing? I > wonder if it may be worth talking about whether to compete with > these meetings in the same week. I appreciate the work it takes to > get these events going. Thanks. > > Mark > > On 3/7/07, Jared Richardson < lists-jared at nc.rr.com> wrote: > Hi all, > > We're trying to see if a local Agile group would work here in RTP, > so here goes! Please let me know if plan to attend so Frankie's can > schedule extra waiters/waitresses as needed. > > > -------------------------- > > http://agileartisans.com/artp/ > > Agile RTP (ARTp) > > Are you a fan of the Manifesto for Agile Software Development and > in the RTP area? If so, come out and join us on our first meeting. > Thursday, March 22nd we'll get together at Frankie's (near Briar > Creek) and have a combination kick-off meeting and also a shared > event with the agile-carolinas group in Charlotte. > > Dr. Laurie Williams will be speaking in Charlotte on Empirical > Studies of Test Driven Development and we'll participate via a > video chat system. > > In the future, I'd like to have on site speakers, but this event > gave us a deadline to get started, so let get rolling. > > When? > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the > room from 6:30 to 8:00. That's their time limit on a free room. > However, if we happen to show up earlier and order food (say, at 6 > pm), I think we'll be fine. > > What? > We'll be listening to Dr. Larie William's Agile Carolina's meeting > via a video link. Dr. Williams will be speaking on Test Driven > Development. I'm told we'll be able to interact and ask questions, > but if we heckle, they'll mute us. > > -------------------------- > > Jared > http://JaredRichardson.net > > > > _______________________________________________ > Juglist mailing list > Juglist at trijug.org > http://trijug.org/mailman/listinfo/juglist_trijug.org > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070315/dd936bf3/attachment.html From rhooker at cisco.com Fri Mar 16 13:57:03 2007 From: rhooker at cisco.com (Raymond Hooker (rhooker)) Date: Fri, 16 Mar 2007 13:57:03 -0400 Subject: [raleigh.rb] Rails for Java Programmers In-Reply-To: References: Message-ID: <848DB51F3E58E146B08D188F803DCB6F03A4261E@xmb-rtp-20c.amer.cisco.com> Perhaps someone could offer some tips. I am going through the Rails_XT application. The application is already generated. The first task was to create the database and execute "rake migrate" (p 98 first printing PDF). Unfortunately rails had been updated to require the controller to be specified which one of the commentators indicated was fixed by: map.connect 'people/:action/:full_name', :controller=>'people' Now rake aborts indicating "Bad file descriptor - connect(2)". I have done a --trace but it is not obvious to me what the problem is.. Has anyone done this example or able to offer debug hints? Ray From rick.denatale at gmail.com Sat Mar 17 10:11:02 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Sat, 17 Mar 2007 10:11:02 -0400 Subject: [raleigh.rb] Rails for Java Programmers In-Reply-To: <848DB51F3E58E146B08D188F803DCB6F03A4261E@xmb-rtp-20c.amer.cisco.com> References: <848DB51F3E58E146B08D188F803DCB6F03A4261E@xmb-rtp-20c.amer.cisco.com> Message-ID: On 3/16/07, Raymond Hooker (rhooker) wrote: > Perhaps someone could offer some tips. I am going through the Rails_XT > application. The application is already generated. The first task was > to create the database and execute "rake migrate" (p 98 first printing > PDF). > > Unfortunately rails had been updated to require the controller to be > specified which one of the commentators indicated was fixed by: > map.connect > 'people/:action/:full_name', :controller=>'people' > > Now rake aborts indicating "Bad file descriptor - connect(2)". I have > done a --trace but it is not obvious to me what the problem is.. > > Has anyone done this example or able to offer debug hints? I don't know the example, but... First of all map.connect 'people/:action/:full_name', :controller=>'people' needs to be on one line: map.connect 'people/:action/:full_name', :controller=>'people' Where did you put that code. If you tried to put it in the migration, which I suspect, then that doesn't look right. the map.connect ... usually goes into config/routes.rb If you look in this file you should see something like: ActionController::Routing::Routes.draw do | map| map.connect ... map.connect ... ... end I think that you want to add that line inside the do block with the other calls to map.connect -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From nospam at tonyspencer.com Sun Mar 18 09:08:16 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Sun, 18 Mar 2007 09:08:16 -0400 Subject: [raleigh.rb] Breakpointer no longer working after Rails upgrade In-Reply-To: <2076BDB2-136B-494D-8CE7-DE2FE8CD4BED@thewilliams.ws> References: <9A768981-9C8B-40CD-9D0D-A7C8A74FD093@tonyspencer.com> <2076BDB2-136B-494D-8CE7-DE2FE8CD4BED@thewilliams.ws> Message-ID: Sorry for resurrecting an old one here. I'm using ruby-debug and its been a nice replacement to the broken breakpointer but do you know how to break out debugger without shutting down Mongrel? Everytime I type 'exit' it closes debugger but takes down Mongrel with it. On Feb 27, 2007, at 7:04 PM, Adam Williams wrote: > Oh man. Now's the time to move to ruby-debug. > > sudo gem install ruby-debug > > in environment.rb, at the bottom, or wherever you think is good: > require 'ruby-debug' > Debugger.start > > then, where you'd use breakpointer > debugger > > You can do all kinds of wonderful things with this. > > adam williams > > On Feb 27, 2007, at 11:52 AM, Tony Spencer wrote: > >> Has anyone else had a problem with breakpointer failing after >> upgrading to the latest version of Rails? >> >> I get the following error when running ./script/breakpointer >> >> /usr/local/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo': getaddrinfo: >> No address associated with nodename (SocketError) >> from /usr/local/lib/ruby/1.8/drb/drb.rb:837:in >> `open_server_inaddr_any' >> from /usr/local/lib/ruby/1.8/drb/drb.rb:860:in `open_server' >> from /usr/local/lib/ruby/1.8/drb/drb.rb:756:in `open_server' >> from /usr/local/lib/ruby/1.8/drb/drb.rb:754:in `open_server' >> from /usr/local/lib/ruby/1.8/drb/drb.rb:1336:in `initialize' >> from /usr/local/lib/ruby/1.8/drb/drb.rb:1624:in >> `start_service' >> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/ >> breakpoint_client.rb:146 >> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/ >> breakpoint_client.rb:145 >> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ >> custom_require.rb:27:in `require' >> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/ >> commands/breakpointer.rb:1 >> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ >> custom_require.rb:27:in `require' >> from script/breakpointer:3 >> >> I'm on ruby 1.8.4 on an Intel Mac and it was working before. >> ARRRGGH! >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From brenton.leanhardt at gmail.com Sun Mar 18 12:33:27 2007 From: brenton.leanhardt at gmail.com (brenton leanhardt) Date: Sun, 18 Mar 2007 12:33:27 -0400 Subject: [raleigh.rb] Breakpointer no longer working after Rails upgrade In-Reply-To: References: <9A768981-9C8B-40CD-9D0D-A7C8A74FD093@tonyspencer.com> <2076BDB2-136B-494D-8CE7-DE2FE8CD4BED@thewilliams.ws> Message-ID: <7c0835400703180933v7438c597se77de1829a5703e9@mail.gmail.com> I may be misunderstanding what you mean by 'break out of debugger' but would simply typing 'c' for 'continue' work? You can type 'help' at the ruby-debug prompt to see a long list of other commands that may be helpful. Then you can type 'help ' to see a description. --Brenton On 3/18/07, Tony Spencer wrote: > > Sorry for resurrecting an old one here. I'm using ruby-debug and its > been a nice replacement to the broken breakpointer but do you know > how to break out debugger without shutting down Mongrel? Everytime I > type 'exit' it closes debugger but takes down Mongrel with it. > > On Feb 27, 2007, at 7:04 PM, Adam Williams wrote: > > > Oh man. Now's the time to move to ruby-debug. > > > > sudo gem install ruby-debug > > > > in environment.rb, at the bottom, or wherever you think is good: > > require 'ruby-debug' > > Debugger.start > > > > then, where you'd use breakpointer > > debugger > > > > You can do all kinds of wonderful things with this. > > > > adam williams > > > > On Feb 27, 2007, at 11:52 AM, Tony Spencer wrote: > > > >> Has anyone else had a problem with breakpointer failing after > >> upgrading to the latest version of Rails? > >> > >> I get the following error when running ./script/breakpointer > >> > >> /usr/local/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo': getaddrinfo: > >> No address associated with nodename (SocketError) > >> from /usr/local/lib/ruby/1.8/drb/drb.rb:837:in > >> `open_server_inaddr_any' > >> from /usr/local/lib/ruby/1.8/drb/drb.rb:860:in `open_server' > >> from /usr/local/lib/ruby/1.8/drb/drb.rb:756:in `open_server' > >> from /usr/local/lib/ruby/1.8/drb/drb.rb:754:in `open_server' > >> from /usr/local/lib/ruby/1.8/drb/drb.rb:1336:in `initialize' > >> from /usr/local/lib/ruby/1.8/drb/drb.rb:1624:in > >> `start_service' > >> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/ > >> breakpoint_client.rb:146 > >> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/ > >> breakpoint_client.rb:145 > >> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > >> custom_require.rb:27:in `require' > >> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/ > >> commands/breakpointer.rb:1 > >> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ > >> custom_require.rb:27:in `require' > >> from script/breakpointer:3 > >> > >> I'm on ruby 1.8.4 on an Intel Mac and it was working before. > >> ARRRGGH! > >> > >> _______________________________________________ > >> raleigh-rb-members mailing list > >> raleigh-rb-members at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070318/8c961001/attachment.html From rhooker at cisco.com Sun Mar 18 21:04:26 2007 From: rhooker at cisco.com (Raymond Hooker (rhooker)) Date: Sun, 18 Mar 2007 21:04:26 -0400 Subject: [raleigh.rb] Rails for Java Programmers In-Reply-To: References: <848DB51F3E58E146B08D188F803DCB6F03A4261E@xmb-rtp-20c.amer.cisco.com> Message-ID: <848DB51F3E58E146B08D188F803DCB6F03AF157A@xmb-rtp-20c.amer.cisco.com> I finally got it. First of all, you were correct that the command needs to be on the same line. In fact, that was the first problem that I had already fixed. Also I failed to mention that I had changed the line in the "config\routes.rb" file. The real problem has to do with updates to rails and the mysql gem since the book came out. What I had to do was to: - Install mysql 5.0, select the option to add the msql directory to the path and bring it up. - I had done a gem install mysql - I also to find the libmsql.dll that I had copied into the ruby\bin directory while trying to debug the problem. It may be if I had installed the ruby from InstantRails instead of the latest fix that perhaps it would have been compatible. As it is, I think I will probably just install each individual package and bring it up when testing.. I can probably just create a quick bat file to start the mysql and apache services. That could be better than trying to deal with the mix matches. Ray P.S. - I still think it is cool book.. I ran into a similar issue when using a book on Eclipse RCP. Of course you learn a lot by breaking things... -----Original Message----- From: raleigh-rb-members-bounces at rubyforge.org [mailto:raleigh-rb-members-bounces at rubyforge.org] On Behalf Of Rick DeNatale Sent: Saturday, March 17, 2007 10:11 AM To: The mailing list of raleigh.rb Subject: Re: [raleigh.rb] Rails for Java Programmers On 3/16/07, Raymond Hooker (rhooker) wrote: > Perhaps someone could offer some tips. I am going through the > Rails_XT application. The application is already generated. The > first task was to create the database and execute "rake migrate" (p 98 > first printing PDF). > > Unfortunately rails had been updated to require the controller to be > specified which one of the commentators indicated was fixed by: > map.connect > 'people/:action/:full_name', :controller=>'people' > > Now rake aborts indicating "Bad file descriptor - connect(2)". I have > done a --trace but it is not obvious to me what the problem is.. > > Has anyone done this example or able to offer debug hints? I don't know the example, but... First of all map.connect 'people/:action/:full_name', :controller=>'people' needs to be on one line: map.connect 'people/:action/:full_name', :controller=>'people' Where did you put that code. If you tried to put it in the migration, which I suspect, then that doesn't look right. the map.connect ... usually goes into config/routes.rb If you look in this file you should see something like: ActionController::Routing::Routes.draw do | map| map.connect ... map.connect ... ... end I think that you want to add that line inside the do block with the other calls to map.connect -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nathaniel at talbott.ws Tue Mar 20 09:47:32 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Tue, 20 Mar 2007 09:47:32 -0400 Subject: [raleigh.rb] Pre-Meeting Chow Message-ID: As usual, anyone who's available is invited to join me at 5:30 tonight at Baja Burrito (http://rubyurl.com/CGF) to grab dinner and some Ruby chatter before heading over to Red Hat for the meeting. While by no means required, a quick RSVP (just reply to this email with "In!" or somesuch) would be great. Looking forward to it, -- Nathaniel Talbott <:((>< From pelargir at gmail.com Tue Mar 20 09:57:31 2007 From: pelargir at gmail.com (Matthew) Date: Tue, 20 Mar 2007 09:57:31 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: References: Message-ID: In. Very much in. On 3/20/07, Nathaniel Talbott wrote: > > As usual, anyone who's available is invited to join me at 5:30 > tonight at Baja Burrito (http://rubyurl.com/CGF) to grab dinner and > some Ruby chatter before heading over to Red Hat for the meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070320/591c168d/attachment-0001.html From ruby at bandkbroom.com Tue Mar 20 14:22:26 2007 From: ruby at bandkbroom.com (Brian Broom) Date: Tue, 20 Mar 2007 14:22:26 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: References: Message-ID: <46002662.7060603@bandkbroom.com> I'll be there Brian > > > > On 3/20/07, *Nathaniel Talbott* > wrote: > > As usual, anyone who's available is invited to join me at 5:30 > tonight at Baja Burrito (http://rubyurl.com/CGF) to grab dinner and > some Ruby chatter before heading over to Red Hat for the meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > ------------------------------------------------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From rick.denatale at gmail.com Wed Mar 21 17:50:54 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Wed, 21 Mar 2007 17:50:54 -0400 Subject: [raleigh.rb] Agile RTP In-Reply-To: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> References: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> Message-ID: I think I'll be able to make it. On 3/7/07, Jared Richardson wrote: > Hi all, > > We're trying to see if a local Agile group would work here in RTP, so here > goes! Please let me know if you're coming so Frankie's can schedule extra > waiters/waitresses as needed. > > > -------------------------- > > http://agileartisans.com/artp/ > > Agile RTP (ARTp) > > Are you a fan of the Manifesto for Agile Software Development and in the RTP > area? If so, come out and join us on our first meeting. Thursday, March 22nd > we'll get together at Frankie's (near Briar Creek) and have a combination > kick-off meeting and also a shared event with the agile-carolinas group in > Charlotte. > > Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies of > Test Driven Development and we'll participate via a video chat system. > > In the future, I'd like to have on site speakers, but this event gave us a > deadline to get started, so let get rolling. > > When? > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room from > 6:30 to 8:00. That's their time limit on a free room. However, if we happen > to show up earlier and order food (say, at 6 pm), I think we'll be fine. > > What? > We'll be listening to Dr. Larie William's Agile Carolina's meeting via a > video link. Dr. Williams will be speaking on Test Driven Development. I'm > told we'll be able to interact and ask questions, but if we heckle, they'll > mute us. > > -------------------------- > > Jared > http://JaredRichardson.net > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ IPMS/USA Region 12 Coordinator http://ipmsr12.denhaven2.com/ Visit the Project Mercury Wiki Site http://www.mercuryspacecraft.com/ From lists-jared at nc.rr.com Wed Mar 21 19:22:27 2007 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 21 Mar 2007 19:22:27 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <46002662.7060603@bandkbroom.com> References: <46002662.7060603@bandkbroom.com> Message-ID: <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> http://www.rubyhoedown.com/ Jared http://JaredRichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070321/a2b22dc4/attachment.html From nathaniel at talbott.ws Wed Mar 21 22:51:27 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Wed, 21 Mar 2007 22:51:27 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> Message-ID: <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> On Mar 21, 2007, at 19:22 , Jared Richardson wrote: > http://www.rubyhoedown.com/ Hey, you beat me to it! Well, as you've all now seen, the Ruby Hoedown 2007 site is up and operational. We'll be announcing more details over the coming weeks and months (so sign up for the announcement list!), but you should start thinking about talks you might want to give. As the date draws closer we'll probably be looking for some volunteers to help out, and I'll post about that when the time comes. If you have any questions, don't hesitate to ask. Thanks! -- Nathaniel Talbott <:((>< From rick.denatale at gmail.com Thu Mar 22 09:00:44 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 22 Mar 2007 09:00:44 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> Message-ID: On 3/21/07, Nathaniel Talbott wrote: > If you have any questions, don't hesitate to ask. Thanks! So what's the web site written in. The '.html' at the end of the urls make me think 'not rails." -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From mark.bennett.mail at gmail.com Thu Mar 22 09:04:46 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 22 Mar 2007 09:04:46 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> Message-ID: Cool page!, who gets credit for the artwork? Mark On 3/21/07, Nathaniel Talbott wrote: > > On Mar 21, 2007, at 19:22 , Jared Richardson wrote: > > > http://www.rubyhoedown.com/ > > Hey, you beat me to it! > > Well, as you've all now seen, the Ruby Hoedown 2007 site is up and > operational. We'll be announcing more details over the coming weeks > and months (so sign up for the announcement list!), but you should > start thinking about talks you might want to give. As the date draws > closer we'll probably be looking for some volunteers to help out, and > I'll post about that when the time comes. > > If you have any questions, don't hesitate to ask. Thanks! > > > -- > Nathaniel Talbott > > <:((>< > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/4e99ec77/attachment.html From nathaniel at talbott.ws Thu Mar 22 09:19:32 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 22 Mar 2007 09:19:32 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> Message-ID: <0D06BA3B-D1F8-4160-8620-A3C13BED1023@talbott.ws> On Mar 22, 2007, at 09:00 , Rick DeNatale wrote: > On 3/21/07, Nathaniel Talbott wrote: > >> If you have any questions, don't hesitate to ask. Thanks! > > So what's the web site written in. The '.html' at the end of the urls > make me think 'not rails." I think the current website is written in that pinnacle of programming languages, HTML :-) Once we get more stuff to publish, I'd imagine we'll switch to Radiant or something along those lines. -- Nathaniel Talbott <:((>< From larry.karnowski at gmail.com Thu Mar 22 09:20:23 2007 From: larry.karnowski at gmail.com (Larry Karnowski) Date: Thu, 22 Mar 2007 09:20:23 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> Message-ID: <2b27183e0703220620u6d600464w2873e99ccea2f661@mail.gmail.com> A "hoedown?" I'll have to bring my Bluegrass band! http://www.rightturnclydes.com/ ;-) On 3/21/07, Nathaniel Talbott wrote: > On Mar 21, 2007, at 19:22 , Jared Richardson wrote: > > > http://www.rubyhoedown.com/ > > Hey, you beat me to it! > > Well, as you've all now seen, the Ruby Hoedown 2007 site is up and > operational. We'll be announcing more details over the coming weeks > and months (so sign up for the announcement list!), but you should > start thinking about talks you might want to give. As the date draws > closer we'll probably be looking for some volunteers to help out, and > I'll post about that when the time comes. > > If you have any questions, don't hesitate to ask. Thanks! > > > -- > Nathaniel Talbott > > <:((>< > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From nathaniel at talbott.ws Thu Mar 22 09:21:51 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 22 Mar 2007 09:21:51 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> Message-ID: <11A8F0F3-FE00-401C-B6EE-07920DE9679E@talbott.ws> On Mar 22, 2007, at 09:04 , Mark Bennett wrote: > Cool page!, who gets credit for the artwork? The main organizer, Jeremy McAnally (http://jeremymcanally.com/). He hails from Tennessee, and is doing a great job making the conference happen. -- Nathaniel Talbott <:((>< From nathaniel at talbott.ws Thu Mar 22 09:39:06 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 22 Mar 2007 09:39:06 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <2b27183e0703220620u6d600464w2873e99ccea2f661@mail.gmail.com> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> <2b27183e0703220620u6d600464w2873e99ccea2f661@mail.gmail.com> Message-ID: On Mar 22, 2007, at 09:20 , Larry Karnowski wrote: > A "hoedown?" I'll have to bring my Bluegrass band! > http://www.rightturnclydes.com/ We might actually take you up on that... I'll be in touch :-) -- Nathaniel Talbott <:((>< From adam at thewilliams.ws Thu Mar 22 10:22:56 2007 From: adam at thewilliams.ws (Adam Williams) Date: Thu, 22 Mar 2007 10:22:56 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> <2b27183e0703220620u6d600464w2873e99ccea2f661@mail.gmail.com> Message-ID: <484C0CD5-4726-4A54-9D78-3C545CC5EFA6@thewilliams.ws> YES! I think this would be an important addition. Yea Larry! adam williams On Mar 22, 2007, at 9:39 AM, Nathaniel Talbott wrote: > On Mar 22, 2007, at 09:20 , Larry Karnowski wrote: > >> A "hoedown?" I'll have to bring my Bluegrass band! >> http://www.rightturnclydes.com/ > > We might actually take you up on that... I'll be in touch :-) > > > -- > Nathaniel Talbott > > <:((>< > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nospam at tonyspencer.com Thu Mar 22 11:14:23 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 22 Mar 2007 11:14:23 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql Message-ID: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> I have a situation whereby the default single table inheritance provided by Rails will not work for me because the classes (models) do not share many columns in common and often have a large number of distinct columns. So if I were to use single table inheritance my number of columns on the base class would get very large quickly and grow every time I add a new model. So I thought the solution is to use class table inheritance: http://www.martinfowler.com/eaaCatalog/ classTableInheritance.html But I couldn't find a clean way to implement CTI with Rails. This guy does it in Postgres but wow that really looks nasty once you get about a quarter way through the post: http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- postgresql And I prefer to work with mySQL. So I only have one idea which is to stick with single table inheritance provided by Rails and break the unique columns out into an attributes table of which there is a foreign key in the base model. So I would end up with: class Thing < ActiveRecord::Base class Car < Thing class Dog < Thing thing ------ id name car_attributes_id dog_attributes_id dog_attributes ----- breed color number_of_legs car_attributes ----- make model color mpg Finally I would implement partials that get rendered on pages like show depending on the type of thing we are talking about. What do you think? Is this a bad idea? Gracias, Tony Spencer From mark.bennett.mail at gmail.com Thu Mar 22 11:23:10 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 22 Mar 2007 11:23:10 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: In your example the only thing they share is 'name'. So here I would use assocations and not inheritance. If there is some functionality that needs to be shared then perhaps mix in a module with the behavior you desire. Mark On 3/22/07, Tony Spencer wrote: > > I have a situation whereby the default single table inheritance > provided by Rails will not work for me because the classes (models) > do not share many columns in common and often have a large number of > distinct columns. So if I were to use single table inheritance my > number of columns on the base class would get very large quickly and > grow every time I add a new model. So I thought the solution is to > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > classTableInheritance.html > > But I couldn't find a clean way to implement CTI with Rails. This > guy does it in Postgres but wow that really looks nasty once you get > about a quarter way through the post: > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > postgresql > > And I prefer to work with mySQL. So I only have one idea which is to > stick with single table inheritance provided by Rails and break the > unique columns out into an attributes table of which there is a > foreign key in the base model. > > So I would end up with: > > class Thing < ActiveRecord::Base > > class Car < Thing > > class Dog < Thing > > thing > ------ > id > name > car_attributes_id > dog_attributes_id > > > dog_attributes > ----- > breed > color > number_of_legs > > car_attributes > ----- > make > model > color > mpg > > Finally I would implement partials that get rendered on pages like > show depending on the type of thing we are talking about. > > What do you think? Is this a bad idea? > > Gracias, > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/62c3977a/attachment.html From nathaniel at talbott.ws Thu Mar 22 11:23:54 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 22 Mar 2007 11:23:54 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: <117A992D-F4AA-4808-854A-961700DEE283@talbott.ws> On Mar 22, 2007, at 11:14 , Tony Spencer wrote: > What do you think? Is this a bad idea? Can you give us more details about why you want to use inheritance in the first place? It sounds like this might be a great spot to either use composition, or to pull behavior out in to a Module that you can include in each of the models. -- Nathaniel Talbott <:((>< From jeffm.keating at gmail.com Thu Mar 22 11:31:15 2007 From: jeffm.keating at gmail.com (Jeff Keating) Date: Thu, 22 Mar 2007 11:31:15 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: If it's this complex, possibly inheritance isn't the answer at all. Maybe your object model is trying too hard to force an inheritance heiararchy that actually doesn't work. For example, under some circumstances Ostrich would not and should not inherit from Bird if Bird as a necessary attribute has a "fly" method that is expected to modify its altitude property to something greater than zero... You might not be gaining much by forcing inheritance just because there are a large number of identical properties or methods between two classes. Think about whether or not they are definitely and easily and appropriately substitutable for each other. On 3/22/07, Tony Spencer wrote: > > I have a situation whereby the default single table inheritance > provided by Rails will not work for me because the classes (models) > do not share many columns in common and often have a large number of > distinct columns. So if I were to use single table inheritance my > number of columns on the base class would get very large quickly and > grow every time I add a new model. So I thought the solution is to > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > classTableInheritance.html > > But I couldn't find a clean way to implement CTI with Rails. This > guy does it in Postgres but wow that really looks nasty once you get > about a quarter way through the post: > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > postgresql > > And I prefer to work with mySQL. So I only have one idea which is to > stick with single table inheritance provided by Rails and break the > unique columns out into an attributes table of which there is a > foreign key in the base model. > > So I would end up with: > > class Thing < ActiveRecord::Base > > class Car < Thing > > class Dog < Thing > > thing > ------ > id > name > car_attributes_id > dog_attributes_id > > > dog_attributes > ----- > breed > color > number_of_legs > > car_attributes > ----- > make > model > color > mpg > > Finally I would implement partials that get rendered on pages like > show depending on the type of thing we are talking about. > > What do you think? Is this a bad idea? > > Gracias, > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/6eacb02c/attachment.html From pelargir at gmail.com Thu Mar 22 11:32:21 2007 From: pelargir at gmail.com (Matthew) Date: Thu, 22 Mar 2007 11:32:21 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: While I am by no means an expert in complex Rails associations, I've generally understood that STI should only be used in cases where most of the columns are shared across the models. It looks like that isn't the case here. I'm not sure what your models look like so this may not be appropriate, but you might consider using separate tables for each model and then employing polymorphic associations to break out the common data. If you really only have a "name" field common across the models like Mark said, though, this would be overkill. Matthew On 3/22/07, Tony Spencer wrote: > > I have a situation whereby the default single table inheritance > provided by Rails will not work for me because the classes (models) > do not share many columns in common and often have a large number of > distinct columns. So if I were to use single table inheritance my > number of columns on the base class would get very large quickly and > grow every time I add a new model. So I thought the solution is to > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > classTableInheritance.html > > But I couldn't find a clean way to implement CTI with Rails. This > guy does it in Postgres but wow that really looks nasty once you get > about a quarter way through the post: > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > postgresql > > And I prefer to work with mySQL. So I only have one idea which is to > stick with single table inheritance provided by Rails and break the > unique columns out into an attributes table of which there is a > foreign key in the base model. > > So I would end up with: > > class Thing < ActiveRecord::Base > > class Car < Thing > > class Dog < Thing > > thing > ------ > id > name > car_attributes_id > dog_attributes_id > > > dog_attributes > ----- > breed > color > number_of_legs > > car_attributes > ----- > make > model > color > mpg > > Finally I would implement partials that get rendered on pages like > show depending on the type of thing we are talking about. > > What do you think? Is this a bad idea? > > Gracias, > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/0236eb11/attachment-0001.html From nospam at tonyspencer.com Thu Mar 22 11:44:14 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 22 Mar 2007 11:44:14 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: Ok, yeah sounds like inheritance may not be the answer and I need to read up on composition and associations. But here is what I'm really trying to implement: I'm building a classifieds system that is generic in the things its lists. On one site it may deal with real estate properties only and on another site running the same system it may list boats, boat_engines, and boat_trailers. But I want the functionality to be the same for all these things meaning that a user can bookmark a property on the real estate site and the user can bookmark a boat on the boat site. An admin can find all boats created in the last day on the boat site and can find all properties created in the last day on the real estate site. On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: > If it's this complex, possibly inheritance isn't the answer at all. > Maybe your object model is trying too hard to force an inheritance > heiararchy that actually doesn't work. For example, under some > circumstances Ostrich would not and should not inherit from Bird if > Bird as a necessary attribute has a "fly" method that is expected > to modify its altitude property to something greater than zero... > You might not be gaining much by forcing inheritance just because > there are a large number of identical properties or methods between > two classes. Think about whether or not they are definitely and > easily and appropriately substitutable for each other. > > On 3/22/07, Tony Spencer wrote: > I have a situation whereby the default single table inheritance > provided by Rails will not work for me because the classes (models) > do not share many columns in common and often have a large number of > distinct columns. So if I were to use single table inheritance my > number of columns on the base class would get very large quickly and > grow every time I add a new model. So I thought the solution is to > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > classTableInheritance.html > > But I couldn't find a clean way to implement CTI with Rails. This > guy does it in Postgres but wow that really looks nasty once you get > about a quarter way through the post: > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > postgresql > > And I prefer to work with mySQL. So I only have one idea which is to > stick with single table inheritance provided by Rails and break the > unique columns out into an attributes table of which there is a > foreign key in the base model. > > So I would end up with: > > class Thing < ActiveRecord::Base > > class Car < Thing > > class Dog < Thing > > thing > ------ > id > name > car_attributes_id > dog_attributes_id > > > dog_attributes > ----- > breed > color > number_of_legs > > car_attributes > ----- > make > model > color > mpg > > Finally I would implement partials that get rendered on pages like > show depending on the type of thing we are talking about. > > What do you think? Is this a bad idea? > > Gracias, > Tony Spencer > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/668dc292/attachment.html From mark.bennett.mail at gmail.com Thu Mar 22 11:51:45 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 22 Mar 2007 11:51:45 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: Primarily what you are modeling are "listings" not the actual objects themselves. Perhaps another entity in you schema would be listing_attributes. Mark On 3/22/07, Tony Spencer wrote: > > Ok, yeah sounds like inheritance may not be the answer and I need to read > up on composition and associations. But here is what I'm really trying to > implement: > > I'm building a classifieds system that is generic in the things its lists. > On one site it may deal with real estate properties only and on another site > running the same system it may list boats, boat_engines, and boat_trailers. > But I want the functionality to be the same for all these things meaning > that a user can bookmark a property on the real estate site and the user can > bookmark a boat on the boat site. An admin can find all boats created in > the last day on the boat site and can find all properties created in the > last day on the real estate site. > > On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: > > If it's this complex, possibly inheritance isn't the answer at all. Maybe > your object model is trying too hard to force an inheritance heiararchy that > actually doesn't work. For example, under some circumstances Ostrich would > not and should not inherit from Bird if Bird as a necessary attribute has a > "fly" method that is expected to modify its altitude property to something > greater than zero... You might not be gaining much by forcing inheritance > just because there are a large number of identical properties or methods > between two classes. Think about whether or not they are definitely and > easily and appropriately substitutable for each other. > > On 3/22/07, Tony Spencer wrote: > > > > I have a situation whereby the default single table inheritance > > provided by Rails will not work for me because the classes (models) > > do not share many columns in common and often have a large number of > > distinct columns. So if I were to use single table inheritance my > > number of columns on the base class would get very large quickly and > > grow every time I add a new model. So I thought the solution is to > > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > > classTableInheritance.html > > > > But I couldn't find a clean way to implement CTI with Rails. This > > guy does it in Postgres but wow that really looks nasty once you get > > about a quarter way through the post: > > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > > postgresql > > > > And I prefer to work with mySQL. So I only have one idea which is to > > stick with single table inheritance provided by Rails and break the > > unique columns out into an attributes table of which there is a > > foreign key in the base model. > > > > So I would end up with: > > > > class Thing < ActiveRecord::Base > > > > class Car < Thing > > > > class Dog < Thing > > > > thing > > ------ > > id > > name > > car_attributes_id > > dog_attributes_id > > > > > > dog_attributes > > ----- > > breed > > color > > number_of_legs > > > > car_attributes > > ----- > > make > > model > > color > > mpg > > > > Finally I would implement partials that get rendered on pages like > > show depending on the type of thing we are talking about. > > > > What do you think? Is this a bad idea? > > > > Gracias, > > Tony Spencer > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/960a68fd/attachment.html From larry.karnowski at gmail.com Thu Mar 22 11:51:54 2007 From: larry.karnowski at gmail.com (Larry Karnowski) Date: Thu, 22 Mar 2007 11:51:54 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <484C0CD5-4726-4A54-9D78-3C545CC5EFA6@thewilliams.ws> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> <2b27183e0703220620u6d600464w2873e99ccea2f661@mail.gmail.com> <484C0CD5-4726-4A54-9D78-3C545CC5EFA6@thewilliams.ws> Message-ID: <2b27183e0703220851n4d884f69u2d6ccf657fff2a1@mail.gmail.com> We'll have to learn this song... http://www.traditionalmusic.co.uk/bluegrass-lyrics/Ruby.html It's sang like "RUUUUUUU-BEEEEEEEE! RUUUUU-eh-BEEEEEEE! Honey are you mad at your man"? ;-) Should be a crowd-pleaser, Larry On 3/22/07, Adam Williams wrote: > YES! I think this would be an important addition. Yea Larry! > > adam williams > > On Mar 22, 2007, at 9:39 AM, Nathaniel Talbott wrote: > > > On Mar 22, 2007, at 09:20 , Larry Karnowski wrote: > > > >> A "hoedown?" I'll have to bring my Bluegrass band! > >> http://www.rightturnclydes.com/ > > > > We might actually take you up on that... I'll be in touch :-) > > > > > > -- > > Nathaniel Talbott > > > > <:((>< > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From jared.haworth at gmail.com Thu Mar 22 11:52:28 2007 From: jared.haworth at gmail.com (Jared Haworth) Date: Thu, 22 Mar 2007 11:52:28 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: If the sites aren't sharing the same database (merely the same schema), why not write it generic and use some from of globalize or internationalization plugin, instead of changing changing a token word into English, French, German; change that token word into "Boat", "Real Estate", etc. - Jared On Mar 22, 2007, at 11:44 AM, Tony Spencer wrote: > Ok, yeah sounds like inheritance may not be the answer and I need > to read up on composition and associations. But here is what I'm > really trying to implement: > > I'm building a classifieds system that is generic in the things its > lists. On one site it may deal with real estate properties only and > on another site running the same system it may list boats, > boat_engines, and boat_trailers. But I want the functionality to > be the same for all these things meaning that a user can bookmark a > property on the real estate site and the user can bookmark a boat > on the boat site. An admin can find all boats created in the last > day on the boat site and can find all properties created in the > last day on the real estate site. > > On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: > >> If it's this complex, possibly inheritance isn't the answer at >> all. Maybe your object model is trying too hard to force an >> inheritance heiararchy that actually doesn't work. For example, >> under some circumstances Ostrich would not and should not inherit >> from Bird if Bird as a necessary attribute has a "fly" method that >> is expected to modify its altitude property to something greater >> than zero... You might not be gaining much by forcing inheritance >> just because there are a large number of identical properties or >> methods between two classes. Think about whether or not they are >> definitely and easily and appropriately substitutable for each other. >> >> On 3/22/07, Tony Spencer wrote: >> I have a situation whereby the default single table inheritance >> provided by Rails will not work for me because the classes (models) >> do not share many columns in common and often have a large number of >> distinct columns. So if I were to use single table inheritance my >> number of columns on the base class would get very large quickly and >> grow every time I add a new model. So I thought the solution is to >> use class table inheritance: http://www.martinfowler.com/eaaCatalog/ >> classTableInheritance.html >> >> But I couldn't find a clean way to implement CTI with Rails. This >> guy does it in Postgres but wow that really looks nasty once you get >> about a quarter way through the post: >> http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails- >> with- >> postgresql >> >> And I prefer to work with mySQL. So I only have one idea which is to >> stick with single table inheritance provided by Rails and break the >> unique columns out into an attributes table of which there is a >> foreign key in the base model. >> >> So I would end up with: >> >> class Thing < ActiveRecord::Base >> >> class Car < Thing >> >> class Dog < Thing >> >> thing >> ------ >> id >> name >> car_attributes_id >> dog_attributes_id >> >> >> dog_attributes >> ----- >> breed >> color >> number_of_legs >> >> car_attributes >> ----- >> make >> model >> color >> mpg >> >> Finally I would implement partials that get rendered on pages like >> show depending on the type of thing we are talking about. >> >> What do you think? Is this a bad idea? >> >> Gracias, >> Tony Spencer >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/32898f44/attachment-0001.html From nospam at tonyspencer.com Thu Mar 22 12:08:39 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 22 Mar 2007 12:08:39 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: I can't make them generic listing attributes. I've done that in the past and its difficult to work with. When they are just listing_attributes you can't easily control them. For instance, perhaps you want price to be the first item in the create form and you want it to be big and bold. You end up doing a lot of iterating and checking. I prefer to know I'm talking about a boat and render a _form with its fields. On Mar 22, 2007, at 11:51 AM, Mark Bennett wrote: > Primarily what you are modeling are "listings" not the actual > objects themselves. Perhaps another entity in you schema would be > listing_attributes. > > Mark > > On 3/22/07, Tony Spencer wrote: > Ok, yeah sounds like inheritance may not be the answer and I need > to read up on composition and associations. But here is what I'm > really trying to implement: > > I'm building a classifieds system that is generic in the things its > lists. On one site it may deal with real estate properties only and > on another site running the same system it may list boats, > boat_engines, and boat_trailers. But I want the functionality to > be the same for all these things meaning that a user can bookmark a > property on the real estate site and the user can bookmark a boat > on the boat site. An admin can find all boats created in the last > day on the boat site and can find all properties created in the > last day on the real estate site. > > On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: > >> If it's this complex, possibly inheritance isn't the answer at >> all. Maybe your object model is trying too hard to force an >> inheritance heiararchy that actually doesn't work. For example, >> under some circumstances Ostrich would not and should not inherit >> from Bird if Bird as a necessary attribute has a "fly" method that >> is expected to modify its altitude property to something greater >> than zero... You might not be gaining much by forcing inheritance >> just because there are a large number of identical properties or >> methods between two classes. Think about whether or not they are >> definitely and easily and appropriately substitutable for each other. >> >> On 3/22/07, Tony Spencer wrote: >> I have a situation whereby the default single table inheritance >> provided by Rails will not work for me because the classes (models) >> do not share many columns in common and often have a large number of >> distinct columns. So if I were to use single table inheritance my >> number of columns on the base class would get very large quickly and >> grow every time I add a new model. So I thought the solution is to >> use class table inheritance: http://www.martinfowler.com/eaaCatalog/ >> classTableInheritance.html >> >> But I couldn't find a clean way to implement CTI with Rails. This >> guy does it in Postgres but wow that really looks nasty once you get >> about a quarter way through the post: >> http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails- >> with- >> postgresql >> >> And I prefer to work with mySQL. So I only have one idea which is to >> stick with single table inheritance provided by Rails and break the >> unique columns out into an attributes table of which there is a >> foreign key in the base model. >> >> So I would end up with: >> >> class Thing < ActiveRecord::Base >> >> class Car < Thing >> >> class Dog < Thing >> >> thing >> ------ >> id >> name >> car_attributes_id >> dog_attributes_id >> >> >> dog_attributes >> ----- >> breed >> color >> number_of_legs >> >> car_attributes >> ----- >> make >> model >> color >> mpg >> >> Finally I would implement partials that get rendered on pages like >> show depending on the type of thing we are talking about. >> >> What do you think? Is this a bad idea? >> >> Gracias, >> Tony Spencer >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/b40fb786/attachment.html From pelargir at gmail.com Thu Mar 22 12:23:25 2007 From: pelargir at gmail.com (Matthew) Date: Thu, 22 Mar 2007 12:23:25 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: It still sounds to me like polymorphic associations might work here. You have your product model/table which has columns on it named thing_id and thing_type. You would then have a "thingable" association (or some other name, I can't think of anything better at the moment) and could then link each product to a boat, piece of real estate, sushi tray, etc. Stick some convenience methods on the product model to tell you if you're dealing with a boat/property/sushi/etc. and you'd be in business. Matthew On 3/22/07, Tony Spencer wrote: > > I can't make them generic listing attributes. I've done that in the past > and its difficult to work with. When they are just listing_attributes you > can't easily control them. For instance, perhaps you want price to be the > first item in the create form and you want it to be big and bold. You end > up doing a lot of iterating and checking. I prefer to know I'm talking > about a boat and render a _form with its fields. > > On Mar 22, 2007, at 11:51 AM, Mark Bennett wrote: > > Primarily what you are modeling are "listings" not the actual objects > themselves. Perhaps another entity in you schema would be > listing_attributes. > > Mark > > On 3/22/07, Tony Spencer wrote: > > > > Ok, yeah sounds like inheritance may not be the answer and I need to > > read up on composition and associations. But here is what I'm really trying > > to implement: > > > > I'm building a classifieds system that is generic in the things its > > lists. On one site it may deal with real estate properties only and on > > another site running the same system it may list boats, boat_engines, and > > boat_trailers. But I want the functionality to be the same for all these > > things meaning that a user can bookmark a property on the real estate site > > and the user can bookmark a boat on the boat site. An admin can find all > > boats created in the last day on the boat site and can find all properties > > created in the last day on the real estate site. > > > > On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: > > > > If it's this complex, possibly inheritance isn't the answer at all. > > Maybe your object model is trying too hard to force an inheritance > > heiararchy that actually doesn't work. For example, under some circumstances > > Ostrich would not and should not inherit from Bird if Bird as a necessary > > attribute has a "fly" method that is expected to modify its altitude > > property to something greater than zero... You might not be gaining much by > > forcing inheritance just because there are a large number of identical > > properties or methods between two classes. Think about whether or not they > > are definitely and easily and appropriately substitutable for each other. > > > > On 3/22/07, Tony Spencer wrote: > > > > > > I have a situation whereby the default single table inheritance > > > provided by Rails will not work for me because the classes (models) > > > do not share many columns in common and often have a large number of > > > distinct columns. So if I were to use single table inheritance my > > > number of columns on the base class would get very large quickly and > > > grow every time I add a new model. So I thought the solution is to > > > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > > > classTableInheritance.html > > > > > > But I couldn't find a clean way to implement CTI with Rails. This > > > guy does it in Postgres but wow that really looks nasty once you get > > > about a quarter way through the post: > > > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > > > > > > postgresql > > > > > > And I prefer to work with mySQL. So I only have one idea which is to > > > stick with single table inheritance provided by Rails and break the > > > unique columns out into an attributes table of which there is a > > > foreign key in the base model. > > > > > > So I would end up with: > > > > > > class Thing < ActiveRecord::Base > > > > > > class Car < Thing > > > > > > class Dog < Thing > > > > > > thing > > > ------ > > > id > > > name > > > car_attributes_id > > > dog_attributes_id > > > > > > > > > dog_attributes > > > ----- > > > breed > > > color > > > number_of_legs > > > > > > car_attributes > > > ----- > > > make > > > model > > > color > > > mpg > > > > > > Finally I would implement partials that get rendered on pages like > > > show depending on the type of thing we are talking about. > > > > > > What do you think? Is this a bad idea? > > > > > > Gracias, > > > Tony Spencer > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/b889d338/attachment-0001.html From nospam at tonyspencer.com Thu Mar 22 12:35:58 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 22 Mar 2007 12:35:58 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: <04E2FA43-1CAB-4446-8F7D-B1348F8F2E86@tonyspencer.com> That sounds like what I originally described. I neglected to show the column 'type' on my Ad model which as you said, you would need to know what you are talking about. And your example relates to mine: thing = ad boat = boat_attributes Though I like your naming better. :) But yes, this is what I was trying to convey originally. On Mar 22, 2007, at 12:23 PM, Matthew wrote: > It still sounds to me like polymorphic associations might work > here. You have your product model/table which has columns on it > named thing_id and thing_type. You would then have a "thingable" > association (or some other name, I can't think of anything better > at the moment) and could then link each product to a boat, piece of > real estate, sushi tray, etc. Stick some convenience methods on the > product model to tell you if you're dealing with a boat/property/ > sushi/etc. and you'd be in business. > > Matthew > > > On 3/22/07, Tony Spencer wrote: > I can't make them generic listing attributes. I've done that in > the past and its difficult to work with. When they are just > listing_attributes you can't easily control them. For instance, > perhaps you want price to be the first item in the create form and > you want it to be big and bold. You end up doing a lot of > iterating and checking. I prefer to know I'm talking about a boat > and render a _form with its fields. > > On Mar 22, 2007, at 11:51 AM, Mark Bennett wrote: > >> Primarily what you are modeling are "listings" not the actual >> objects themselves. Perhaps another entity in you schema would be >> listing_attributes. >> >> Mark >> >> On 3/22/07, Tony Spencer < nospam at tonyspencer.com> wrote: >> Ok, yeah sounds like inheritance may not be the answer and I need >> to read up on composition and associations. But here is what I'm >> really trying to implement: >> >> I'm building a classifieds system that is generic in the things >> its lists. On one site it may deal with real estate properties >> only and on another site running the same system it may list >> boats, boat_engines, and boat_trailers. But I want the >> functionality to be the same for all these things meaning that a >> user can bookmark a property on the real estate site and the user >> can bookmark a boat on the boat site. An admin can find all boats >> created in the last day on the boat site and can find all >> properties created in the last day on the real estate site. >> >> On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: >> >>> If it's this complex, possibly inheritance isn't the answer at >>> all. Maybe your object model is trying too hard to force an >>> inheritance heiararchy that actually doesn't work. For example, >>> under some circumstances Ostrich would not and should not inherit >>> from Bird if Bird as a necessary attribute has a "fly" method >>> that is expected to modify its altitude property to something >>> greater than zero... You might not be gaining much by forcing >>> inheritance just because there are a large number of identical >>> properties or methods between two classes. Think about whether or >>> not they are definitely and easily and appropriately >>> substitutable for each other. >>> >>> On 3/22/07, Tony Spencer wrote: >>> I have a situation whereby the default single table inheritance >>> provided by Rails will not work for me because the classes (models) >>> do not share many columns in common and often have a large number of >>> distinct columns. So if I were to use single table inheritance my >>> number of columns on the base class would get very large quickly and >>> grow every time I add a new model. So I thought the solution is to >>> use class table inheritance: http://www.martinfowler.com/eaaCatalog/ >>> classTableInheritance.html >>> >>> But I couldn't find a clean way to implement CTI with Rails. This >>> guy does it in Postgres but wow that really looks nasty once you get >>> about a quarter way through the post: >>> http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails- >>> with- >>> postgresql >>> >>> And I prefer to work with mySQL. So I only have one idea which >>> is to >>> stick with single table inheritance provided by Rails and break the >>> unique columns out into an attributes table of which there is a >>> foreign key in the base model. >>> >>> So I would end up with: >>> >>> class Thing < ActiveRecord::Base >>> >>> class Car < Thing >>> >>> class Dog < Thing >>> >>> thing >>> ------ >>> id >>> name >>> car_attributes_id >>> dog_attributes_id >>> >>> >>> dog_attributes >>> ----- >>> breed >>> color >>> number_of_legs >>> >>> car_attributes >>> ----- >>> make >>> model >>> color >>> mpg >>> >>> Finally I would implement partials that get rendered on pages like >>> show depending on the type of thing we are talking about. >>> >>> What do you think? Is this a bad idea? >>> >>> Gracias, >>> Tony Spencer >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/35792300/attachment.html From nospam at tonyspencer.com Thu Mar 22 13:07:46 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 22 Mar 2007 13:07:46 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: <4E75B260-9DD2-46BF-BD10-D833871F8574@tonyspencer.com> Sorry. I misunderstood you before and wasn't aware of Rails polymorphic associations. I get it know! Thanks! On Mar 22, 2007, at 12:23 PM, Matthew wrote: > It still sounds to me like polymorphic associations might work > here. You have your product model/table which has columns on it > named thing_id and thing_type. You would then have a "thingable" > association (or some other name, I can't think of anything better > at the moment) and could then link each product to a boat, piece of > real estate, sushi tray, etc. Stick some convenience methods on the > product model to tell you if you're dealing with a boat/property/ > sushi/etc. and you'd be in business. > > Matthew > > > On 3/22/07, Tony Spencer wrote: > I can't make them generic listing attributes. I've done that in > the past and its difficult to work with. When they are just > listing_attributes you can't easily control them. For instance, > perhaps you want price to be the first item in the create form and > you want it to be big and bold. You end up doing a lot of > iterating and checking. I prefer to know I'm talking about a boat > and render a _form with its fields. > > On Mar 22, 2007, at 11:51 AM, Mark Bennett wrote: > >> Primarily what you are modeling are "listings" not the actual >> objects themselves. Perhaps another entity in you schema would be >> listing_attributes. >> >> Mark >> >> On 3/22/07, Tony Spencer < nospam at tonyspencer.com> wrote: >> Ok, yeah sounds like inheritance may not be the answer and I need >> to read up on composition and associations. But here is what I'm >> really trying to implement: >> >> I'm building a classifieds system that is generic in the things >> its lists. On one site it may deal with real estate properties >> only and on another site running the same system it may list >> boats, boat_engines, and boat_trailers. But I want the >> functionality to be the same for all these things meaning that a >> user can bookmark a property on the real estate site and the user >> can bookmark a boat on the boat site. An admin can find all boats >> created in the last day on the boat site and can find all >> properties created in the last day on the real estate site. >> >> On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: >> >>> If it's this complex, possibly inheritance isn't the answer at >>> all. Maybe your object model is trying too hard to force an >>> inheritance heiararchy that actually doesn't work. For example, >>> under some circumstances Ostrich would not and should not inherit >>> from Bird if Bird as a necessary attribute has a "fly" method >>> that is expected to modify its altitude property to something >>> greater than zero... You might not be gaining much by forcing >>> inheritance just because there are a large number of identical >>> properties or methods between two classes. Think about whether or >>> not they are definitely and easily and appropriately >>> substitutable for each other. >>> >>> On 3/22/07, Tony Spencer wrote: >>> I have a situation whereby the default single table inheritance >>> provided by Rails will not work for me because the classes (models) >>> do not share many columns in common and often have a large number of >>> distinct columns. So if I were to use single table inheritance my >>> number of columns on the base class would get very large quickly and >>> grow every time I add a new model. So I thought the solution is to >>> use class table inheritance: http://www.martinfowler.com/eaaCatalog/ >>> classTableInheritance.html >>> >>> But I couldn't find a clean way to implement CTI with Rails. This >>> guy does it in Postgres but wow that really looks nasty once you get >>> about a quarter way through the post: >>> http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails- >>> with- >>> postgresql >>> >>> And I prefer to work with mySQL. So I only have one idea which >>> is to >>> stick with single table inheritance provided by Rails and break the >>> unique columns out into an attributes table of which there is a >>> foreign key in the base model. >>> >>> So I would end up with: >>> >>> class Thing < ActiveRecord::Base >>> >>> class Car < Thing >>> >>> class Dog < Thing >>> >>> thing >>> ------ >>> id >>> name >>> car_attributes_id >>> dog_attributes_id >>> >>> >>> dog_attributes >>> ----- >>> breed >>> color >>> number_of_legs >>> >>> car_attributes >>> ----- >>> make >>> model >>> color >>> mpg >>> >>> Finally I would implement partials that get rendered on pages like >>> show depending on the type of thing we are talking about. >>> >>> What do you think? Is this a bad idea? >>> >>> Gracias, >>> Tony Spencer >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/5770842b/attachment-0001.html From rick.denatale at gmail.com Thu Mar 22 14:27:50 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 22 Mar 2007 14:27:50 -0400 Subject: [raleigh.rb] Ah ha! In-Reply-To: <2b27183e0703220851n4d884f69u2d6ccf657fff2a1@mail.gmail.com> References: <46002662.7060603@bandkbroom.com> <93FCD466-F0E0-443F-A898-872E8E818DC5@nc.rr.com> <2448D9B4-A0FB-4A56-8490-9028A04E5EDD@talbott.ws> <2b27183e0703220620u6d600464w2873e99ccea2f661@mail.gmail.com> <484C0CD5-4726-4A54-9D78-3C545CC5EFA6@thewilliams.ws> <2b27183e0703220851n4d884f69u2d6ccf657fff2a1@mail.gmail.com> Message-ID: On 3/22/07, Larry Karnowski wrote: > We'll have to learn this song... > http://www.traditionalmusic.co.uk/bluegrass-lyrics/Ruby.html > > It's sang like "RUUUUUUU-BEEEEEEEE! RUUUUU-eh-BEEEEEEE! Honey are > you mad at your man"? ;-) > > Should be a crowd-pleaser, > Larry Not really bluegrass, but... Mamas don't let your babies grow up to be programmers. Don't let em flip bits and read them old dumps. Turns em to wierdos and hermits and drunks. Mamas don't let your babies grow up to be programmers. They'll never get home, and their always alone, Sitting in front of their tubes. (c) 1995 or thereabouts by Rick DeNatale with apologies to Willie Nelson, and the Raleigh.rb mailing list. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From rick.denatale at gmail.com Thu Mar 22 15:02:07 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Thu, 22 Mar 2007 15:02:07 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: <4E75B260-9DD2-46BF-BD10-D833871F8574@tonyspencer.com> References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> <4E75B260-9DD2-46BF-BD10-D833871F8574@tonyspencer.com> Message-ID: On 3/22/07, Tony Spencer wrote: > > Sorry. I misunderstood you before and wasn't aware of Rails polymorphic > associations. I get it know! Thanks! Rails now has pretty good support for polymorphic associations which is well documented in the second edition of Active Web Development with Rails. It's definitely in Rails 1.2, I don't know if it's in 1.1.x and if so in which version. Here's a brief sketch. 1) You build a model to represent the polymorphic side of the association: class PolymorphicResource < ActiveRecord::Base belongs_to :resource, :polymorphic => true end The table for this model needs to have an integer column 'resource_id',m and a string column 'resource_type', resource_id is just like a normal foreign key id field, resource_type holds the model name of the actual resource object it represents which allows both the table and class name to be instantiated to be determined. And this model/table can have additional attributes. 2) Each of the models for the possible values of the other end of the association look like this: class ResourceType1 < ActiveRecord::Base has_one :polymorphic_resource, :as => :resource end class ResourceType2 < ActiveRecord::Base has_one :polymorphic_resource, :as => :resource end of course you would use more meaningful names for the classes and there's nothing magical about :resource Now you can do things like: r1 = Resource1.new(...) p1 = PolymorphicResource.new(...) p1.resource = r1. p1.save r1_id = r1.id p1_id = p2.id r2 = Resource2.new(...) p2 = PolymorphicResource.new(...) p2.resource = Resource2. p2.save r2_id = r2.id p2_id = p2.id p PolymorphicResource.find(p1_id).resource => Resource1(id=r1_id, ...) p PolymorphicResource.find(p2_id).resource => Resource2(id=r2_id, ...) p Resource1.find(r1_id).polymorphic_resource => PolymorphicResource(id=p1_id,...) p Resource2.find(r1_id).polymorphic_resource => PolymorphicResource(id=p2_id,...) Hopefully I haven't messed up this example, I tried to generalize whats in AWDWR. In any case you should get the gist. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From mark.bennett.mail at gmail.com Thu Mar 22 15:31:29 2007 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 22 Mar 2007 15:31:29 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: I still wonder if you want something more dynamic for a classifieds app. I wouldn't want to hack the model when someone decides to add a jetski, a three-wheeler, a condo... Or add columns every time some wants to add a new attribute like psi, acreage, finish, hp... It sounds like you want a general purpose reusable app. I would think you could create it in a way that that you didn't have to have to rework your models and schema for each deployement. Also you can gather your attributes into a Hash and then access them by name. HTH. Mark On 3/22/07, Tony Spencer wrote: > > I can't make them generic listing attributes. I've done that in the past > and its difficult to work with. When they are just listing_attributes you > can't easily control them. For instance, perhaps you want price to be the > first item in the create form and you want it to be big and bold. You end > up doing a lot of iterating and checking. I prefer to know I'm talking > about a boat and render a _form with its fields. > > On Mar 22, 2007, at 11:51 AM, Mark Bennett wrote: > > Primarily what you are modeling are "listings" not the actual objects > themselves. Perhaps another entity in you schema would be > listing_attributes. > > Mark > > On 3/22/07, Tony Spencer wrote: > > > > Ok, yeah sounds like inheritance may not be the answer and I need to > > read up on composition and associations. But here is what I'm really trying > > to implement: > > > > I'm building a classifieds system that is generic in the things its > > lists. On one site it may deal with real estate properties only and on > > another site running the same system it may list boats, boat_engines, and > > boat_trailers. But I want the functionality to be the same for all these > > things meaning that a user can bookmark a property on the real estate site > > and the user can bookmark a boat on the boat site. An admin can find all > > boats created in the last day on the boat site and can find all properties > > created in the last day on the real estate site. > > > > On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: > > > > If it's this complex, possibly inheritance isn't the answer at all. > > Maybe your object model is trying too hard to force an inheritance > > heiararchy that actually doesn't work. For example, under some circumstances > > Ostrich would not and should not inherit from Bird if Bird as a necessary > > attribute has a "fly" method that is expected to modify its altitude > > property to something greater than zero... You might not be gaining much by > > forcing inheritance just because there are a large number of identical > > properties or methods between two classes. Think about whether or not they > > are definitely and easily and appropriately substitutable for each other. > > > > On 3/22/07, Tony Spencer wrote: > > > > > > I have a situation whereby the default single table inheritance > > > provided by Rails will not work for me because the classes (models) > > > do not share many columns in common and often have a large number of > > > distinct columns. So if I were to use single table inheritance my > > > number of columns on the base class would get very large quickly and > > > grow every time I add a new model. So I thought the solution is to > > > use class table inheritance: http://www.martinfowler.com/eaaCatalog/ > > > classTableInheritance.html > > > > > > But I couldn't find a clean way to implement CTI with Rails. This > > > guy does it in Postgres but wow that really looks nasty once you get > > > about a quarter way through the post: > > > http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails-with- > > > > > > postgresql > > > > > > And I prefer to work with mySQL. So I only have one idea which is to > > > stick with single table inheritance provided by Rails and break the > > > unique columns out into an attributes table of which there is a > > > foreign key in the base model. > > > > > > So I would end up with: > > > > > > class Thing < ActiveRecord::Base > > > > > > class Car < Thing > > > > > > class Dog < Thing > > > > > > thing > > > ------ > > > id > > > name > > > car_attributes_id > > > dog_attributes_id > > > > > > > > > dog_attributes > > > ----- > > > breed > > > color > > > number_of_legs > > > > > > car_attributes > > > ----- > > > make > > > model > > > color > > > mpg > > > > > > Finally I would implement partials that get rendered on pages like > > > show depending on the type of thing we are talking about. > > > > > > What do you think? Is this a bad idea? > > > > > > Gracias, > > > Tony Spencer > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/aa1e7b1b/attachment.html From nospam at tonyspencer.com Thu Mar 22 15:49:13 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 22 Mar 2007 15:49:13 -0400 Subject: [raleigh.rb] Implementing class table inheritance in mySql In-Reply-To: References: <53D2CDFC-708C-4C42-B203-9F3C8E96678E@tonyspencer.com> Message-ID: <761C718E-71C9-4554-A474-444398934362@tonyspencer.com> I can understand why you would gravitate towards a dynamic classifieds app. I did it 5 years ago and its still running and works really well but its complex and difficult to style well. And if it weren't for caching the performance would be very poor. Basically the ease of adding models and columns in Rails has made me gravitate more towards defining these things in tables. Also I'm not going to be managing a lot of different types of things but the number of records in the DB is going to be quite large. On Mar 22, 2007, at 3:31 PM, Mark Bennett wrote: > I still wonder if you want something more dynamic for a classifieds > app. I wouldn't want to hack the model when someone decides to add > a jetski, a three-wheeler, a condo... Or add columns every time > some wants to add a new attribute like psi, acreage, finish, > hp... It sounds like you want a general purpose reusable app. I > would think you could create it in a way that that you didn't have > to have to rework your models and schema for each deployement. > > Also you can gather your attributes into a Hash and then access > them by name. HTH. > > Mark > > On 3/22/07, Tony Spencer wrote: > I can't make them generic listing attributes. I've done that in > the past and its difficult to work with. When they are just > listing_attributes you can't easily control them. For instance, > perhaps you want price to be the first item in the create form and > you want it to be big and bold. You end up doing a lot of > iterating and checking. I prefer to know I'm talking about a boat > and render a _form with its fields. > > On Mar 22, 2007, at 11:51 AM, Mark Bennett wrote: > >> Primarily what you are modeling are "listings" not the actual >> objects themselves. Perhaps another entity in you schema would be >> listing_attributes. >> >> Mark >> >> On 3/22/07, Tony Spencer < nospam at tonyspencer.com> wrote: >> Ok, yeah sounds like inheritance may not be the answer and I need >> to read up on composition and associations. But here is what I'm >> really trying to implement: >> >> I'm building a classifieds system that is generic in the things >> its lists. On one site it may deal with real estate properties >> only and on another site running the same system it may list >> boats, boat_engines, and boat_trailers. But I want the >> functionality to be the same for all these things meaning that a >> user can bookmark a property on the real estate site and the user >> can bookmark a boat on the boat site. An admin can find all boats >> created in the last day on the boat site and can find all >> properties created in the last day on the real estate site. >> >> On Mar 22, 2007, at 11:31 AM, Jeff Keating wrote: >> >>> If it's this complex, possibly inheritance isn't the answer at >>> all. Maybe your object model is trying too hard to force an >>> inheritance heiararchy that actually doesn't work. For example, >>> under some circumstances Ostrich would not and should not inherit >>> from Bird if Bird as a necessary attribute has a "fly" method >>> that is expected to modify its altitude property to something >>> greater than zero... You might not be gaining much by forcing >>> inheritance just because there are a large number of identical >>> properties or methods between two classes. Think about whether or >>> not they are definitely and easily and appropriately >>> substitutable for each other. >>> >>> On 3/22/07, Tony Spencer wrote: >>> I have a situation whereby the default single table inheritance >>> provided by Rails will not work for me because the classes (models) >>> do not share many columns in common and often have a large number of >>> distinct columns. So if I were to use single table inheritance my >>> number of columns on the base class would get very large quickly and >>> grow every time I add a new model. So I thought the solution is to >>> use class table inheritance: http://www.martinfowler.com/eaaCatalog/ >>> classTableInheritance.html >>> >>> But I couldn't find a clean way to implement CTI with Rails. This >>> guy does it in Postgres but wow that really looks nasty once you get >>> about a quarter way through the post: >>> http://johnwilger.com/2005/9/29/class-table-inheritance-in-rails- >>> with- >>> postgresql >>> >>> And I prefer to work with mySQL. So I only have one idea which >>> is to >>> stick with single table inheritance provided by Rails and break the >>> unique columns out into an attributes table of which there is a >>> foreign key in the base model. >>> >>> So I would end up with: >>> >>> class Thing < ActiveRecord::Base >>> >>> class Car < Thing >>> >>> class Dog < Thing >>> >>> thing >>> ------ >>> id >>> name >>> car_attributes_id >>> dog_attributes_id >>> >>> >>> dog_attributes >>> ----- >>> breed >>> color >>> number_of_legs >>> >>> car_attributes >>> ----- >>> make >>> model >>> color >>> mpg >>> >>> Finally I would implement partials that get rendered on pages like >>> show depending on the type of thing we are talking about. >>> >>> What do you think? Is this a bad idea? >>> >>> Gracias, >>> Tony Spencer >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/6493ad2d/attachment-0001.html From bhansley at gmail.com Thu Mar 22 16:23:53 2007 From: bhansley at gmail.com (Bill Hansley) Date: Thu, 22 Mar 2007 16:23:53 -0400 Subject: [raleigh.rb] Agile RTP In-Reply-To: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> References: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> Message-ID: <51b534310703221323r87fc71wa5d8dbe8902ff70c@mail.gmail.com> I'd love to come, but can't today. Keep me posted on these events. Thanks! -Bill On 3/7/07, Jared Richardson wrote: > > Hi all, > > We're trying to see if a local Agile group would work here in RTP, so here > goes! Please let me know if you're coming so Frankie's can schedule extra > waiters/waitresses as needed. > > > -------------------------- > > http://agileartisans.com/artp/ > > Agile RTP (ARTp) > > Are you a fan of the Manifesto for Agile Software Development and in the > RTP area? If so, come out and join us on our first meeting. Thursday, March > 22nd we'll get together at Frankie's (near Briar Creek) and have a > combination kick-off meeting and also a shared event with the > agile-carolinas group in Charlotte. > > Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies of > Test Driven Development and we'll participate via a video chat system. > > In the future, I'd like to have on site speakers, but this event gave us a > deadline to get started, so let get rolling. > > When? > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room from > 6:30 to 8:00. That's their time limit on a free room. However, if we happen > to show up earlier and order food (say, at 6 pm), I think we'll be fine. > > What? > We'll be listening to Dr. Larie William's Agile Carolina's meeting via a > video link. Dr. Williams will be speaking on Test Driven Development. I'm > told we'll be able to interact and ask questions, but if we heckle, they'll > mute us. > > -------------------------- > > Jared > http://JaredRichardson.net > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070322/88f2c5c5/attachment.html From tj at stank.us Thu Mar 22 16:32:34 2007 From: tj at stank.us (TJ Stankus) Date: Thu, 22 Mar 2007 16:32:34 -0400 Subject: [raleigh.rb] Agile RTP In-Reply-To: <51b534310703221323r87fc71wa5d8dbe8902ff70c@mail.gmail.com> References: <2B5BBE3D-8309-4CD8-B482-C301D5E8851E@nc.rr.com> <51b534310703221323r87fc71wa5d8dbe8902ff70c@mail.gmail.com> Message-ID: I may be there, depending on my daughter's (unpredictable) afternoon schedule. -TJ On 3/22/07, Bill Hansley wrote: > I'd love to come, but can't today. Keep me posted on these events. > Thanks! > -Bill > > On 3/7/07, Jared Richardson < lists-jared at nc.rr.com> wrote: > > > > > > Hi all, > > > > > > > > We're trying to see if a local Agile group would work here in RTP, so here > goes! Please let me know if you're coming so Frankie's can schedule extra > waiters/waitresses as needed. > > > > > > > > > > -------------------------- > > > > > > http://agileartisans.com/artp/ > > > > > > Agile RTP (ARTp) > > > > > > Are you a fan of the Manifesto for Agile Software Development and in the > RTP area? If so, come out and join us on our first meeting. Thursday, March > 22nd we'll get together at Frankie's (near Briar Creek) and have a > combination kick-off meeting and also a shared event with the > agile-carolinas group in Charlotte. > > > > > > Dr. Laurie Williams will be speaking in Charlotte on Empirical Studies of > Test Driven Development and we'll participate via a video chat system. > > > > > > In the future, I'd like to have on site speakers, but this event gave us a > deadline to get started, so let get rolling. > > > > > > When? > > March 22nd, 2007 from 6:30 to 8 pm. We only officially have the room from > 6:30 to 8:00. That's their time limit on a free room. However, if we happen > to show up earlier and order food (say, at 6 pm), I think we'll be fine. > > > > > > What? > > We'll be listening to Dr. Larie William's Agile Carolina's meeting via a > video link. Dr. Williams will be speaking on Test Driven Development. I'm > told we'll be able to interact and ask questions, but if we heckle, they'll > mute us. > > > > > > -------------------------- > > > > > > Jared > > http://JaredRichardson.net > > > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From nospam at tonyspencer.com Fri Mar 23 11:34:56 2007 From: nospam at tonyspencer.com (Tony Spencer) Date: Fri, 23 Mar 2007 11:34:56 -0400 Subject: [raleigh.rb] Opinions on Substruct? Message-ID: Happy Friday! Has anyone here tried out Substruct for a shopping cart that has an opinion they'd like to share? It would be nice to not have to reinvent the wheel but given the amount of hacking I've had to do in the past on prebuilt ecommerce systems I'm inclined to build my own. http://dev.subimage.com/projects/substruct Tony From rick.denatale at gmail.com Mon Mar 26 18:46:40 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Mon, 26 Mar 2007 18:46:40 -0400 Subject: [raleigh.rb] Deploying different rails apps in Apache virtual hosts on the same machine. Message-ID: I'm currently running typo with a configuration like this. Apache2 => pen => mongrel_cluster I'm using pen instead of pound because of advice on Coda Hale's blog. I'm using a balancer like pen or pound because I'm running Ubuntu dapper, and I don't want to muck with installing Apache 2 from source to get proxy-balancer. I've got typo running in a name-based virtual host. I've got several other name-based hosts on the same machine running other things like mediawiki, etc. Now, I'm starting to think about hosting another rails app or two, and use different virtual host names to differentiate them. So, I guess what I'm asking is if anyone has any experience and/or advice on running multiple instances of pen and mongrel_cluster on the same machine. Is it just a matter of copying and editing the init scripts to point to different configuration files, and to store the process pids in separate files, or are there some gotchas, or better yet, nice shiny tools to do what I'm looking for. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From tj at stank.us Mon Mar 26 21:29:52 2007 From: tj at stank.us (TJ Stankus) Date: Mon, 26 Mar 2007 21:29:52 -0400 Subject: [raleigh.rb] Deploying different rails apps in Apache virtual hosts on the same machine. In-Reply-To: References: Message-ID: I'm running two separate mongrel clusters behind Apache/mod_proxy_balancer without any problems. No pen in the mix, but I don't have a need for it with mod_proxy_balancer. I messed around with deprec and liked their method better than my old way. Deprec (by default) creates a apache2/conf/apps directory. In this directory is one .conf file per Rails app. Then in httpd.conf: Include conf/apps to pull the various app conf files in. If setting all this stuff up sounds like a pain, I recommend checking out deprec. I spent a day or so messing with it and it's paid off big time. http://wiki.slicehost.com/doku.php?id=automated_rails_install_and_deployment_with_deprec_capistrano http://forum.slicehost.com/comments.php?DiscussionID=296 Perhaps not the exact answer you were seeking, but I hope it helps. -TJ On 3/26/07, Rick DeNatale wrote: > I'm currently running typo with a configuration like this. > > Apache2 => pen => mongrel_cluster > > I'm using pen instead of pound because of advice on Coda Hale's blog. > I'm using a balancer like pen or pound because I'm running Ubuntu > dapper, and I don't want to muck with installing Apache 2 from source > to get proxy-balancer. > > I've got typo running in a name-based virtual host. I've got several > other name-based hosts on the same machine running other things like > mediawiki, etc. > > Now, I'm starting to think about hosting another rails app or two, and > use different virtual host names to differentiate them. > > So, I guess what I'm asking is if anyone has any experience and/or > advice on running multiple instances of pen and mongrel_cluster on the > same machine. Is it just a matter of copying and editing the init > scripts to point to different configuration files, and to store the > process pids in separate files, or are there some gotchas, or better > yet, nice shiny tools to do what I'm looking for. > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From rick.denatale at gmail.com Tue Mar 27 11:28:05 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 27 Mar 2007 11:28:05 -0400 Subject: [raleigh.rb] Deploying different rails apps in Apache virtual hosts on the same machine. In-Reply-To: References: Message-ID: TJ Thanks for the pointers I'll look into this. Are you running Ubuntu? Did you have to install Apache from source to get the version which supports mod_proxy_balancer? On 3/26/07, TJ Stankus wrote: > I'm running two separate mongrel clusters behind > Apache/mod_proxy_balancer without any problems. No pen in the mix, but > I don't have a need for it with mod_proxy_balancer. I messed around > with deprec and liked their method better than my old way. Deprec (by > default) creates a apache2/conf/apps directory. In this directory is > one .conf file per Rails app. Then in httpd.conf: > > Include conf/apps > > to pull the various app conf files in. > > If setting all this stuff up sounds like a pain, I recommend checking > out deprec. I spent a day or so messing with it and it's paid off big > time. > > http://wiki.slicehost.com/doku.php?id=automated_rails_install_and_deployment_with_deprec_capistrano > > http://forum.slicehost.com/comments.php?DiscussionID=296 > > Perhaps not the exact answer you were seeking, but I hope it helps. > > -TJ > > On 3/26/07, Rick DeNatale wrote: > > I'm currently running typo with a configuration like this. > > > > Apache2 => pen => mongrel_cluster > > > > I'm using pen instead of pound because of advice on Coda Hale's blog. > > I'm using a balancer like pen or pound because I'm running Ubuntu > > dapper, and I don't want to muck with installing Apache 2 from source > > to get proxy-balancer. > > > > I've got typo running in a name-based virtual host. I've got several > > other name-based hosts on the same machine running other things like > > mediawiki, etc. > > > > Now, I'm starting to think about hosting another rails app or two, and > > use different virtual host names to differentiate them. > > > > So, I guess what I'm asking is if anyone has any experience and/or > > advice on running multiple instances of pen and mongrel_cluster on the > > same machine. Is it just a matter of copying and editing the init > > scripts to point to different configuration files, and to store the > > process pids in separate files, or are there some gotchas, or better > > yet, nice shiny tools to do what I'm looking for. > > > > -- > > Rick DeNatale > > > > My blog on Ruby > > http://talklikeaduck.denhaven2.com/ > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ IPMS/USA Region 12 Coordinator http://ipmsr12.denhaven2.com/ Visit the Project Mercury Wiki Site http://www.mercuryspacecraft.com/ From lists-jared at nc.rr.com Tue Mar 27 11:36:07 2007 From: lists-jared at nc.rr.com (Jared Richardson) Date: Tue, 27 Mar 2007 11:36:07 -0400 Subject: [raleigh.rb] Rails performance In-Reply-To: References: Message-ID: I'm curious if anyone had any thoughts on the relative speed of Grails versus Rails? http://www.infoq.com/news/2007/03/grails-vs-rails I'm surprised more people haven't chipped in on the topic. Also, from Graeme's blog (http://docs.codehaus.org/display/GRAILS/ Grails+vs+Rails+Benchmark): Each call to save() in ActiveRecord immediately persists the data whilst Hibernate batches updates up until the end. That sounds terrible for data integrity, but I'm not familiar enough with Hibernate's internals to know if it's an accurate statement. If it is, I doubt any tool that actually writes the data to disk could keep up. Thoughts? Jared http://JaredRichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070327/96dbebdb/attachment-0001.html From tj at stank.us Tue Mar 27 11:49:19 2007 From: tj at stank.us (TJ Stankus) Date: Tue, 27 Mar 2007 11:49:19 -0400 Subject: [raleigh.rb] Deploying different rails apps in Apache virtual hosts on the same machine. In-Reply-To: References: Message-ID: Yes Ubuntu Dapper server version. I did install apache from source, but used deprec to do it (in other words I cheated). If it helps, here's a slightly customized Capistrano task from deprec. I customized just to change the version of apache from 2.2.3 to 2.2.4 task :install_apache do version = 'httpd-2.2.4' set :src_package, { :file => version + '.tar.gz', :md5sum => 'f72ffb176e2dc7b322be16508c09f63c httpd-2.2.4.tar.gz', :dir => version, :url => "http://www.apache.org/dist/httpd/#{version}.tar.gz", :unpack => "tar zxf #{version}.tar.gz;", :configure => './configure --enable-proxy --enable-proxy-balancer --enable-proxy-http --enable-rewrite --enable-cache --enable-headers --enable-ssl --enable-deflate;', :make => 'make;', :install => 'make install;', :post_install => 'install -b support/apachectl /etc/init.d/httpd;' } deprec.download_src(src_package, src_dir) deprec.install_from_src(src_package, src_dir) # ubuntu specific - should instead call generic name which can be picked up by different distros send(run_method, "update-rc.d httpd defaults") end -TJ On 3/27/07, Rick DeNatale wrote: > TJ > > Thanks for the pointers I'll look into this. > > Are you running Ubuntu? Did you have to install Apache from source to > get the version which supports mod_proxy_balancer? > > On 3/26/07, TJ Stankus wrote: > > I'm running two separate mongrel clusters behind > > Apache/mod_proxy_balancer without any problems. No pen in the mix, but > > I don't have a need for it with mod_proxy_balancer. I messed around > > with deprec and liked their method better than my old way. Deprec (by > > default) creates a apache2/conf/apps directory. In this directory is > > one .conf file per Rails app. Then in httpd.conf: > > > > Include conf/apps > > > > to pull the various app conf files in. > > > > If setting all this stuff up sounds like a pain, I recommend checking > > out deprec. I spent a day or so messing with it and it's paid off big > > time. > > > > http://wiki.slicehost.com/doku.php?id=automated_rails_install_and_deployment_with_deprec_capistrano > > > > http://forum.slicehost.com/comments.php?DiscussionID=296 > > > > Perhaps not the exact answer you were seeking, but I hope it helps. > > > > -TJ > > > > On 3/26/07, Rick DeNatale wrote: > > > I'm currently running typo with a configuration like this. > > > > > > Apache2 => pen => mongrel_cluster > > > > > > I'm using pen instead of pound because of advice on Coda Hale's blog. > > > I'm using a balancer like pen or pound because I'm running Ubuntu > > > dapper, and I don't want to muck with installing Apache 2 from source > > > to get proxy-balancer. > > > > > > I've got typo running in a name-based virtual host. I've got several > > > other name-based hosts on the same machine running other things like > > > mediawiki, etc. > > > > > > Now, I'm starting to think about hosting another rails app or two, and > > > use different virtual host names to differentiate them. > > > > > > So, I guess what I'm asking is if anyone has any experience and/or > > > advice on running multiple instances of pen and mongrel_cluster on the > > > same machine. Is it just a matter of copying and editing the init > > > scripts to point to different configuration files, and to store the > > > process pids in separate files, or are there some gotchas, or better > > > yet, nice shiny tools to do what I'm looking for. > > > > > > -- > > > Rick DeNatale > > > > > > My blog on Ruby > > > http://talklikeaduck.denhaven2.com/ > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > > IPMS/USA Region 12 Coordinator > http://ipmsr12.denhaven2.com/ > > Visit the Project Mercury Wiki Site > http://www.mercuryspacecraft.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From geoff at geoffdavis.net Tue Mar 27 12:02:13 2007 From: geoff at geoffdavis.net (Geoff Davis) Date: Tue, 27 Mar 2007 12:02:13 -0400 Subject: [raleigh.rb] Rails performance In-Reply-To: References: Message-ID: <41DDE4B3-9FA3-4A7C-9D92-21E2689C89A7@geoffdavis.net> What is Grails? On Mar 27, 2007, at 11:36 AM, Jared Richardson wrote: > I'm curious if anyone had any thoughts on the relative speed of > Grails versus Rails? > > http://www.infoq.com/news/2007/03/grails-vs-rails > > I'm surprised more people haven't chipped in on the topic. > > Also, from Graeme's blog (http://docs.codehaus.org/display/GRAILS/ > Grails+vs+Rails+Benchmark): > > Each call to save() in ActiveRecord immediately persists the data > whilst Hibernate batches updates up until the end. > > That sounds terrible for data integrity, but I'm not familiar > enough with Hibernate's internals to know if it's an accurate > statement. If it is, I doubt any tool that actually writes the data > to disk could keep up. > > Thoughts? > > Jared > http://JaredRichardson.net > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070327/c65edf66/attachment.html From rick.denatale at gmail.com Tue Mar 27 12:18:02 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 27 Mar 2007 12:18:02 -0400 Subject: [raleigh.rb] Deploying different rails apps in Apache virtual hosts on the same machine. In-Reply-To: References: Message-ID: Thanks, Well, I'm going to have to gulp a bit before I remove Apache 2.1 to replace it since I've got quite a bit of stuff running on it right now. On 3/27/07, TJ Stankus wrote: > Yes Ubuntu Dapper server version. I did install apache from source, > but used deprec to do it (in other words I cheated). If it helps, > here's a slightly customized Capistrano task from deprec. I customized > just to change the version of apache from 2.2.3 to 2.2.4 > > task :install_apache do > version = 'httpd-2.2.4' > set :src_package, { > :file => version + '.tar.gz', > :md5sum => 'f72ffb176e2dc7b322be16508c09f63c httpd-2.2.4.tar.gz', > :dir => version, > :url => "http://www.apache.org/dist/httpd/#{version}.tar.gz", > :unpack => "tar zxf #{version}.tar.gz;", > :configure => './configure --enable-proxy > --enable-proxy-balancer --enable-proxy-http --enable-rewrite > --enable-cache --enable-headers --enable-ssl --enable-deflate;', > :make => 'make;', > :install => 'make install;', > :post_install => 'install -b support/apachectl /etc/init.d/httpd;' > } > deprec.download_src(src_package, src_dir) > deprec.install_from_src(src_package, src_dir) > # ubuntu specific - should instead call generic name which can be > picked up by different distros > send(run_method, "update-rc.d httpd defaults") > end > > -TJ > > > On 3/27/07, Rick DeNatale wrote: > > TJ > > > > Thanks for the pointers I'll look into this. > > > > Are you running Ubuntu? Did you have to install Apache from source to > > get the version which supports mod_proxy_balancer? > > > > On 3/26/07, TJ Stankus wrote: > > > I'm running two separate mongrel clusters behind > > > Apache/mod_proxy_balancer without any problems. No pen in the mix, but > > > I don't have a need for it with mod_proxy_balancer. I messed around > > > with deprec and liked their method better than my old way. Deprec (by > > > default) creates a apache2/conf/apps directory. In this directory is > > > one .conf file per Rails app. Then in httpd.conf: > > > > > > Include conf/apps > > > > > > to pull the various app conf files in. > > > > > > If setting all this stuff up sounds like a pain, I recommend checking > > > out deprec. I spent a day or so messing with it and it's paid off big > > > time. > > > > > > http://wiki.slicehost.com/doku.php?id=automated_rails_install_and_deployment_with_deprec_capistrano > > > > > > http://forum.slicehost.com/comments.php?DiscussionID=296 > > > > > > Perhaps not the exact answer you were seeking, but I hope it helps. > > > > > > -TJ > > > > > > On 3/26/07, Rick DeNatale wrote: > > > > I'm currently running typo with a configuration like this. > > > > > > > > Apache2 => pen => mongrel_cluster > > > > > > > > I'm using pen instead of pound because of advice on Coda Hale's blog. > > > > I'm using a balancer like pen or pound because I'm running Ubuntu > > > > dapper, and I don't want to muck with installing Apache 2 from source > > > > to get proxy-balancer. > > > > > > > > I've got typo running in a name-based virtual host. I've got several > > > > other name-based hosts on the same machine running other things like > > > > mediawiki, etc. > > > > > > > > Now, I'm starting to think about hosting another rails app or two, and > > > > use different virtual host names to differentiate them. > > > > > > > > So, I guess what I'm asking is if anyone has any experience and/or > > > > advice on running multiple instances of pen and mongrel_cluster on the > > > > same machine. Is it just a matter of copying and editing the init > > > > scripts to point to different configuration files, and to store the > > > > process pids in separate files, or are there some gotchas, or better > > > > yet, nice shiny tools to do what I'm looking for. > > > > > > > > -- > > > > Rick DeNatale > > > > > > > > My blog on Ruby > > > > http://talklikeaduck.denhaven2.com/ > > > > _______________________________________________ > > > > raleigh-rb-members mailing list > > > > raleigh-rb-members at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > > -- > > Rick DeNatale > > > > My blog on Ruby > > http://talklikeaduck.denhaven2.com/ > > > > IPMS/USA Region 12 Coordinator > > http://ipmsr12.denhaven2.com/ > > > > Visit the Project Mercury Wiki Site > > http://www.mercuryspacecraft.com/ > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ IPMS/USA Region 12 Coordinator http://ipmsr12.denhaven2.com/ Visit the Project Mercury Wiki Site http://www.mercuryspacecraft.com/ From rick.denatale at gmail.com Tue Mar 27 12:21:18 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 27 Mar 2007 12:21:18 -0400 Subject: [raleigh.rb] Rails performance In-Reply-To: <41DDE4B3-9FA3-4A7C-9D92-21E2689C89A7@geoffdavis.net> References: <41DDE4B3-9FA3-4A7C-9D92-21E2689C89A7@geoffdavis.net> Message-ID: On 3/27/07, Geoff Davis wrote: > What is Grails? As I understand it: Grails:Groovy :: Rails::Ruby Groovy is a YADOOL* running on the Java VM. *YADOOL is "Yet Another Dynamic Object Oriented Language" -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From geoff at geoffdavis.net Tue Mar 27 12:23:21 2007 From: geoff at geoffdavis.net (Geoff Davis) Date: Tue, 27 Mar 2007 12:23:21 -0400 Subject: [raleigh.rb] Rails performance In-Reply-To: References: <41DDE4B3-9FA3-4A7C-9D92-21E2689C89A7@geoffdavis.net> Message-ID: <4B52CEAA-3DD6-44F5-9AE7-D73D08F943BD@geoffdavis.net> Aha! Thanks. /me ignores, waits for YARV. On Mar 27, 2007, at 12:21 PM, Rick DeNatale wrote: > On 3/27/07, Geoff Davis wrote: >> What is Grails? > > As I understand it: > > Grails:Groovy :: Rails::Ruby > > Groovy is a YADOOL* running on the Java VM. > > *YADOOL is "Yet Another Dynamic Object Oriented Language" > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From pelargir at gmail.com Tue Mar 27 13:23:31 2007 From: pelargir at gmail.com (Matthew) Date: Tue, 27 Mar 2007 13:23:31 -0400 Subject: [raleigh.rb] WWR interview with Ryan Daigle Message-ID: Ryan is a regular attendee of raleigh.rb, a Ruby/Rails coder, and just an overall great guy. He won Working With Rails' Hackfest contest in January by being one of the top 20 contributors to Rails during that month. Congrats, Ryan! Here's his interview that was posted today on the WWR site: http://weblog.workingwithrails.com/2007/3/27/hackfest-winner-interviews-ryan-daigle Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20070327/0f475700/attachment-0001.html From nathaniel at talbott.ws Tue Mar 27 13:27:47 2007 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Tue, 27 Mar 2007 13:27:47 -0400 Subject: [raleigh.rb] WWR interview with Ryan Daigle In-Reply-To: References: Message-ID: <402E2FFF-17F8-4D0C-88C2-08767295F2EF@talbott.ws> On Mar 27, 2007, at 13:23 , Matthew wrote: > Ryan is a regular attendee of raleigh.rb, a Ruby/Rails coder, and > just an overall great guy. He won Working With Rails' Hackfest > contest in January by being one of the top 20 contributors to Rails > during that month. Congrats, Ryan! > > Here's his interview that was posted today on the WWR site: > > http://weblog.workingwithrails.com/2007/3/27/hackfest-winner- > interviews-ryan-daigle FYI, sucking up to him is a good strategy if you're wanting to present at the Ruby Hoedown, since he's just become our program chair. ;-) -- Nathaniel Talbott <:((>< From adam at thewilliams.ws Tue Mar 27 17:55:57 2007 From: adam at thewilliams.ws (Adam Williams) Date: Tue, 27 Mar 2007 17:55:57 -0400 Subject: [raleigh.rb] Rails performance In-Reply-To: References: Message-ID: On Mar 27, 2007, at 11:36 AM, Jared Richardson wrote: > I'm curious if anyone had any thoughts on the relative speed of > Grails versus Rails? > > http://www.infoq.com/news/2007/03/grails-vs-rails > > I'm surprised more people haven't chipped in on the topic. I have no clue, but I am quite familiar with Hibernate... > Also, from Graeme's blog (http://docs.codehaus.org/display/GRAILS/ > Grails+vs+Rails+Benchmark): > > Each call to save() in ActiveRecord immediately persists the data > whilst Hibernate batches updates up until the end. > > That sounds terrible for data integrity, but I'm not familiar > enough with Hibernate's internals to know if it's an accurate > statement. If it is, I doubt any tool that actually writes the data > to disk could keep up. He's vague, but correct. One of the biggest challenges I faced when I came to ActiveRecord was the fact that there is no identity map, or first level cache. In Hibernate, that facility provides a power that is quite handy: session scoped object identity. We're not talking about entity identity, or record identity. We're talking real, object == object identity. So what? Well, when you pull a record out of the database and 'hydrate' an object, any subsequent query you do that would yield that record, you get the same instance while you have your session open, which means all kinds of things in how you end up programming. Transactions in Hibernate also provide change tracking. Hibernate only writes back the stuff that has changed, and only when you commit your transaction - which, by the way, you must create to start change tracking, for those of you paying really close attention. I could say quite a bit more if you are interested. Hibernate's architecture is quite different from ARs (Domain Mapper vs. Active Record, Martin Fowler). While all the meta-programming, class- changing stuff in AR is cool, I prefer the power of Hibernate, but not at the cost of not using Ruby ;) Adam Williams From ruby at bandkbroom.com Fri Mar 30 21:35:34 2007 From: ruby at bandkbroom.com (Brian Broom) Date: Fri, 30 Mar 2007 21:35:34 -0400 Subject: [raleigh.rb] Deprec and capistrano In-Reply-To: References: Message-ID: <460DBAE6.7020202@bandkbroom.com> I'm trying to play around with capistrano and deprec, and everything seems to go well until I get to the svn part. I have tried two things 1. using role: scm in deploy.rb to import into a repository (which did not work) 2. importing into svn on another machine, and trying to check it out (which didn't work either) Does anyone have any experience with cap bombing at this stage? any ideas? (by the way, virtual machines are a great way to play with this stuff. I'm using the beta of VMware fusion, and an image of ubuntu server) Thanks Brian From tj at stank.us Fri Mar 30 23:36:53 2007 From: tj at stank.us (TJ Stankus) Date: Fri, 30 Mar 2007 23:36:53 -0400 Subject: [raleigh.rb] Deprec and capistrano In-Reply-To: <460DBAE6.7020202@bandkbroom.com> References: <460DBAE6.7020202@bandkbroom.com> Message-ID: I use the following line and it seems to work: role :scm, domain When I run cap deploy I get prompted for my subversion password in the middle of the task, then it continues on successfully. Maybe you were missing the ', domain' part of that line? -TJ On 3/30/07, Brian Broom wrote: > I'm trying to play around with capistrano and deprec, and everything > seems to go well until I get to the svn part. I have tried two things > > 1. using role: scm in deploy.rb to import into a repository (which did > not work) > > 2. importing into svn on another machine, and trying to check it out > (which didn't work either) > > Does anyone have any experience with cap bombing at this stage? any ideas? > > (by the way, virtual machines are a great way to play with this stuff. > I'm using the beta of VMware fusion, and an image of ubuntu server) > > Thanks > Brian > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From ruby at bandkbroom.com Sat Mar 31 00:31:44 2007 From: ruby at bandkbroom.com (Brian Broom) Date: Sat, 31 Mar 2007 00:31:44 -0400 Subject: [raleigh.rb] Deprec and capistrano In-Reply-To: References: <460DBAE6.7020202@bandkbroom.com> Message-ID: <460DE430.7040501@bandkbroom.com> Yeah, that's how I had it set up. It was failing at some line in svn.rb, where repository#something (tags maybe, I don't remember) was being called, but it looked like repository was not being set. The task failed with a no method on nil object error. I was able to get it to checkout from another svn server (that is once I put the svn address in the correct file). This is also the first time I've fooled around with this, so I'll probably blow it away and try it again. One question: you said that you are prompted for your svn password? I thought that role :scm was saying that you wanted svn setup on *this* machine (ie it is not setup currently), do you have to have setup a svn user before you start? Thanks Brian TJ Stankus wrote: > I use the following line and it seems to work: > > role :scm, domain > > When I run cap deploy I get prompted for my subversion password in the > middle of the task, then it continues on successfully. Maybe you were > missing the ', domain' part of that line? > > -TJ > > On 3/30/07, Brian Broom wrote: > >> I'm trying to play around with capistrano and deprec, and everything >> seems to go well until I get to the svn part. I have tried two things >> >> 1. using role: scm in deploy.rb to import into a repository (which did >> not work) >> >> 2. importing into svn on another machine, and trying to check it out >> (which didn't work either) >> >> Does anyone have any experience with cap bombing at this stage? any ideas? >> >> (by the way, virtual machines are a great way to play with this stuff. >> I'm using the beta of VMware fusion, and an image of ubuntu server) >> >> Thanks >> Brian >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > From rick.denatale at gmail.com Sat Mar 31 10:19:31 2007 From: rick.denatale at gmail.com (Rick DeNatale) Date: Sat, 31 Mar 2007 10:19:31 -0400 Subject: [raleigh.rb] Intermittent 502 errors and Rails/Typo load balancing. Message-ID: I recently added a small ruby script to my cron jobs which acts as a watchdog on my blog. Every so often I try to get the main page and if I get a response other than a 200 I email myself with the result. About twice a week or so I'm seeing something like the forwarded message below. It' seems to be intermittent. My setup is Apache 2.1 proxying to pen which load balances to a mongrel cluster of processes running typo. These are all running on the same machine. Is this just evidence that I should be running more mongrels because my blog is more popular that I expected, or should I be looking for something more serious. ---------- Forwarded message ---------- From: talklikeaduck at denhaven2.com Date: Mar 31, 2007 1:01 AM Subject: 502 Response from talklikeaduck.denhaven2.com/ To: undisclosed-recipients Response message = Proxy Error 502 Proxy Error

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.

Reason: Error reading from remote server


Apache Server at talklikeaduck.denhaven2.com Port 80
-- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From PKristoff at acm.org Sat Mar 31 09:47:12 2007 From: PKristoff at acm.org (PKristoff at acm.org) Date: Sat, 31 Mar 2007 09:47:12 -0400 Subject: [raleigh.rb] Ruby Study Group In-Reply-To: <460DBAE6.7020202@bandkbroom.com> Message-ID: <04e101c7739b$15c97d80$1602a8c0@PaulsLaptopII> Folks, We will be meeting as part of the Ruby Hack night on Thursday. What: Ruby Study Group When: Thursday, April 5th, 2007 at 6pm Where: Panera Bread 7840 Alexander Promenade Place (near intersection of 540 and 70) Raleigh NC 27617 919-293-0900 Agenda: We will continue with Ruby Quiz one for those of us who have not finished. I will also have a second quiz available. See you there. Paul Kristoff 214-598-9610 PKristoff at acm.org www.PaulKristoff.com From lists-jared at nc.rr.com Sat Mar 31 15:29:45 2007 From: lists-jared at nc.rr.com (Jared Richardson) Date: Sat, 31 Mar 2007 15:29:45 -0400 Subject: [raleigh.rb] Intermittent 502 errors and Rails/Typo load balancing. In-Reply-To: References: Message-ID: <0DDDB3C0-C721-45EF-AD8B-6B099574B6A8@nc.rr.com> I think it's because Pen is trying to talk to a port that doesn't have a Mongrel on it. I'd suspect that your configuration between Pen and Mongrel Cluster are off by one or one of your Mongrels has crashed. Jared http://JaredRichardson.net On Mar 31, 2007, at 10:19 AM |Mar/31, Rick DeNatale wrote: > I recently added a small ruby script to my cron jobs which acts as a > watchdog on my blog. Every so often I try to get the main page and if > I get a response other than a 200 I email myself with the result. > > About twice a week or so I'm seeing something like the forwarded > message below. It' seems to be intermittent. > > My setup is Apache 2.1 proxying to pen which load balances to a > mongrel cluster of processes running typo. These are all running on > the same machine. > > Is this just evidence that I should be running more mongrels because > my blog is more popular that I expected, or should I be looking for > something more serious. > > ---------- Forwarded message ---------- > From: talklikeaduck at denhaven2.com > Date: Mar 31, 2007 1:01 AM > Subject: 502 Response from talklikeaduck.denhaven2.com/ > To: undisclosed-recipients > > > Response message = Proxy Error > > > > 502 Proxy Error > >

Proxy Error

>

The proxy server received an invalid > response from an upstream server.
> The proxy server could not handle the request href="/">GET /.

> Reason: Error reading from remote server

>
>
Apache Server at talklikeaduck.denhaven2.com Port 80 address> > > > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members