From harini.r.iyer at gmail.com Tue Dec 1 14:13:33 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 14:13:33 -0500 Subject: [raleigh.rb] Ruby with cygwin for backgroundrb Message-ID: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> Hi, So I finally gave up trying to start the start the backgroundrb server on windows and I am trying to use Cygwin. However, I keep bumping into errors. I installed ruby (one click installer) amd rubygems0.9.3. But when i do a ruby setup.rb to install gems, it throws an error saying taht the ruby_version variable might be uninitialized . I have no idea how to proceed in order to make this backgroundrb work on cygwin. If there are any users who have made it work on cygwin, could you please tell me which version of ruby and gems are needed and how do i install them (coz apparently, i am just hitting errors all the time). Thank You, Harini From harini.r.iyer at gmail.com Tue Dec 1 14:21:06 2009 From: harini.r.iyer at gmail.com (harini iyer) Date: Tue, 1 Dec 2009 14:21:06 -0500 Subject: [raleigh.rb] [Backgroundrb-devel] Ruby with cygwin for backgroundrb In-Reply-To: <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> References: <404e0d6d0912011113h255f7f61r6434c2d7484e71bc@mail.gmail.com> <95a868280912011116p4f060ba9w8217fc4ee1bc5e69@mail.gmail.com> Message-ID: <404e0d6d0912011121u38666d59lb7c1092c97afb9b6@mail.gmail.com> Thats exactly what I did. But I feel I am still going wrong somewhere. Could you please tell me which versions of Ruby adn Gems would work for cygwin? I am sure that I am making some mistake there. Thank you, Harini On Tue, Dec 1, 2009 at 2:16 PM, Justin Wood wrote: > Treat it like a completely separate environment do gem installs and updates > just like you would a new machine and that should get you there. > > On Wed, Dec 2, 2009 at 8:13 AM, harini iyer wrote: >> >> Hi, >> >> So I finally gave up trying to start the start the backgroundrb server >> on windows and I am trying to use Cygwin. However, I keep bumping into >> errors. I installed ruby (one click installer) amd rubygems0.9.3. But >> when i do a ruby setup.rb to install gems, it throws an error saying >> taht the ruby_version variable might be uninitialized . >> I have no idea how to proceed in order to make this backgroundrb work >> on cygwin. >> >> If there are any users who have made it work on cygwin, could you >> please tell me which version of ruby and gems are needed and how do i >> install them (coz apparently, i am just hitting errors all the time). >> >> Thank You, >> Harini >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > -- > Justin Wood > Senior Software Architect > > > New Zealand Office, > 57 Wellington Street, > Freemans Bay, > Auckland, > New Zealand > > > M ?+64 27 225 0749 ?| ?P ? +64 9 370 0168 ?| ?F ? +64 9 361 6504 > E ? justin.wood at trifectagis.com ?| ?Free: ? ?0800 trifecta > Skype: ?nztrifecta > > www.trifectagis.com > From seancribbs at gmail.com Tue Dec 1 14:35:07 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 01 Dec 2009 14:35:07 -0500 Subject: [raleigh.rb] O/T: Pre-ARTp grub Message-ID: <4B156FEB.4050701@gmail.com> Anyone going to AgileRTP tonight and want to get some dinner beforehand? The meeting is at iContact in RTP. Sean From redinger at gmail.com Tue Dec 1 14:42:23 2009 From: redinger at gmail.com (Christopher Redinger) Date: Tue, 1 Dec 2009 14:42:23 -0500 Subject: [raleigh.rb] O/T: Pre-ARTp grub In-Reply-To: <4B156FEB.4050701@gmail.com> References: <4B156FEB.4050701@gmail.com> Message-ID: On Dec 1, 2009, at 2:35 PM, Sean Cribbs wrote: > Anyone going to AgileRTP tonight and want to get some dinner beforehand? The meeting is at iContact in RTP. I'd be interested. When & where? -- Christopher Redinger http://agiledisciple.com Agile Ruby and Rails Development (919) 386-9643 From seancribbs at gmail.com Tue Dec 1 15:21:49 2009 From: seancribbs at gmail.com (Sean Cribbs) Date: Tue, 01 Dec 2009 15:21:49 -0500 Subject: [raleigh.rb] O/T: Pre-ARTp grub In-Reply-To: References: <4B156FEB.4050701@gmail.com> Message-ID: <4B157ADD.1010000@gmail.com> Don't know anything in that area, really. Any suggestions? Sean Christopher Redinger wrote: > On Dec 1, 2009, at 2:35 PM, Sean Cribbs wrote: > > >> Anyone going to AgileRTP tonight and want to get some dinner beforehand? The meeting is at iContact in RTP. >> > > I'd be interested. When & where? > > -- > Christopher Redinger > http://agiledisciple.com > Agile Ruby and Rails Development > (919) 386-9643 > > _______________________________________________ > 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: From minter at lunenburg.org Mon Dec 7 16:23:57 2009 From: minter at lunenburg.org (H. Wade Minter) Date: Mon, 7 Dec 2009 15:23:57 -0600 Subject: [raleigh.rb] [JOB] Ruby/Rails dev job at Rackspace in Texas Message-ID: <85C765D2-8FE9-42DB-9720-592BE80ED1B4@lunenburg.org> Greetings, Triangle! I'm writing from San Antonio, where I've been since April 2008 working with Rackspace. There's an opening for a Rails developer on my team, so I figured I'd write back home and see if anyone else wanted to make the journey to the land of chorizo and honey. I'm part of a two-person internal development group at Rackspace, writing apps to make life easier for the frontline guys. Quite a bit of process automation, data integration, and the like, but with a big opportunity to just code up stuff that will help people get their jobs done or make life more pleasant for them. We have a suite of about 20 different small-medium sized apps to maintain, and a list of new stuff to write going forward. This position is located in San Antonio, home of the River Walk, the Spurs, the Alamo, and more. Rackspace itself has engineering offices in San Antonio, Austin, Blacksburg, and London. If anyone wants more details, feel free to drop me a line! Let's Go Canes, --Wade From nathaniel at talbott.ws Thu Dec 10 10:34:05 2009 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 10 Dec 2009 10:34:05 -0500 Subject: [raleigh.rb] Christmas Book Exchange Update Message-ID: <4ce336a20912100734t13dd702ap31506bb5ba6ad392@mail.gmail.com> Preparation for the Book Exchange is coming along great, including a box I just picked up from the Prags comprised of some "surprises" for everyone. You won't want to miss it! As a reminder, you need to bring one thing: * A book you're passionate about, wrapped up for maximum surprise value In addition, I'd like everyone with any culinary abilities (or related/married/otherwise able to bribe someone with culinary abilities) to consider bringing: * A tasty treat to share I'll be bringing drinks, and they'll be so much better paired with some munchies! As I've seen various of you, I've heard lots of excitement about the event, so be sure to RSVP (http://www.meetup.com/raleighrb/calendar/11377547/) and be there on Tuesday night. Lets make it an event remembered for years to come! P.S. Any questions, comments, concerns, etc., don't hesitate to drop me an email. -- Nathaniel Talbott <:((>< From brandan at bclennox.com Thu Dec 10 09:04:34 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Thu, 10 Dec 2009 09:04:34 -0500 Subject: [raleigh.rb] ActionView::TemplateError with sprockets_include_tag Message-ID: <83D94F41-0589-49B5-92AC-7F8A2A92B126@bclennox.com> Helloes, I'm using Sprockets to manage my JS on a couple of projects. Every time I restart my app, the very first page load throws an exception: ActionView::TemplateError (undefined local variable or method `sprockets_include_tag' for #)... But after that, everything works fine until the next restart. Fortunately, sprockets_include_tag just calls javascript_include_tag('/sprockets.js'), so I worked around it by doing that myself, but I can't figure out why the exception is being thrown in the first place. Here's vendor/plugins/sprockets-rails/init.rb: > # ... > class ActionController::Base > helper :sprockets > end And the SprocketsHelper: > module SprocketsHelper > def sprockets_include_tag > javascript_include_tag("/sprockets.js") > end > end This happens in development and production environments. Google is no help. Any ideas? sprockets-rails 1bffeeb51886abe6c6c37cdaee043a6b5787710a sprockets 1.0.2 rails 2.3.4 Thanks! Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.streicher at gmail.com Fri Dec 11 00:23:14 2009 From: martin.streicher at gmail.com (Martin Streicher) Date: Fri, 11 Dec 2009 00:23:14 -0500 Subject: [raleigh.rb] ActionView::TemplateError with sprockets_include_tag In-Reply-To: <83D94F41-0589-49B5-92AC-7F8A2A92B126@bclennox.com> References: <83D94F41-0589-49B5-92AC-7F8A2A92B126@bclennox.com> Message-ID: <0655E3B4-4426-46E5-9050-554B2E1717A4@gmail.com> It sounds like a load order problem. Can you require or include earlier, before the sprockets_include_tag is used? Martin On Dec 10, 2009, at 9:04 AM, Brandan Lennox wrote: > Helloes, > > I'm using Sprockets to manage my JS on a couple of projects. Every > time I restart my app, the very first page load throws an exception: > > ActionView::TemplateError (undefined local variable or method > `sprockets_include_tag' for #)... > > But after that, everything works fine until the next restart. > > Fortunately, sprockets_include_tag just calls > javascript_include_tag('/sprockets.js'), so I worked around it by > doing that myself, but I can't figure out why the exception is being > thrown in the first place. > > Here's vendor/plugins/sprockets-rails/init.rb: > >> # ... >> class ActionController::Base >> helper :sprockets >> end > > And the SprocketsHelper: > >> module SprocketsHelper >> def sprockets_include_tag >> javascript_include_tag("/sprockets.js") >> end >> end > > This happens in development and production environments. Google is > no help. Any ideas? > > sprockets-rails 1bffeeb51886abe6c6c37cdaee043a6b5787710a > sprockets 1.0.2 > rails 2.3.4 > > Thanks! > > Brandan L. > -- > brandan at bclennox.com > http://www.bclennox.com > +1 (919) 274.7565 > > > > > > > > > _______________________________________________ > 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: From brandan at bclennox.com Fri Dec 11 09:28:58 2009 From: brandan at bclennox.com (Brandan Lennox) Date: Fri, 11 Dec 2009 09:28:58 -0500 Subject: [raleigh.rb] ActionView::TemplateError with sprockets_include_tag In-Reply-To: <0655E3B4-4426-46E5-9050-554B2E1717A4@gmail.com> References: <83D94F41-0589-49B5-92AC-7F8A2A92B126@bclennox.com> <0655E3B4-4426-46E5-9050-554B2E1717A4@gmail.com> Message-ID: <169F66B8-8AB8-4A5E-8AE5-63D952C34DAE@bclennox.com> Well, I added this line to config/environment.rb: config.plugins = [ 'sprockets-rails', :all ] but the problem persisted. That did get me thinking that it was a conflict with my gems, though. I ended up creating a pristine app with all my gem requirements and only a single call to sprockets_include_tag in the layout, and eventually I narrowed it down to resource_controller. Since resource_controller lets you subclass ResourceController::Base in your controllers, most of my controllers weren't actually inheriting from ActionController::Base, which is what Sprockets modifies in its init.rb. I wrote my own config/initializers/sprockets.rb to open up ApplicationController and include the helper, and all is well! Thanks! Brandan L. -- brandan at bclennox.com http://www.bclennox.com +1 (919) 274.7565 On Dec 11, 2009, at 12:23 AM, Martin Streicher wrote: > > It sounds like a load order problem. Can you require or include earlier, before the sprockets_include_tag is used? > > Martin > > > > On Dec 10, 2009, at 9:04 AM, Brandan Lennox wrote: > >> Helloes, >> >> I'm using Sprockets to manage my JS on a couple of projects. Every time I restart my app, the very first page load throws an exception: >> >> ActionView::TemplateError (undefined local variable or method `sprockets_include_tag' for #)... >> >> But after that, everything works fine until the next restart. >> >> Fortunately, sprockets_include_tag just calls javascript_include_tag('/sprockets.js'), so I worked around it by doing that myself, but I can't figure out why the exception is being thrown in the first place. >> >> Here's vendor/plugins/sprockets-rails/init.rb: >> >>> # ... >>> class ActionController::Base >>> helper :sprockets >>> end >> >> And the SprocketsHelper: >> >>> module SprocketsHelper >>> def sprockets_include_tag >>> javascript_include_tag("/sprockets.js") >>> end >>> end >> >> This happens in development and production environments. Google is no help. Any ideas? >> >> sprockets-rails 1bffeeb51886abe6c6c37cdaee043a6b5787710a >> sprockets 1.0.2 >> rails 2.3.4 >> >> Thanks! >> >> Brandan L. >> -- >> brandan at bclennox.com >> http://www.bclennox.com >> +1 (919) 274.7565 >> >> >> >> >> >> >> >> >> _______________________________________________ >> 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: From adam at thewilliams.ws Mon Dec 14 17:50:19 2009 From: adam at thewilliams.ws (Adam Williams) Date: Mon, 14 Dec 2009 17:50:19 -0500 Subject: [raleigh.rb] Rails Developer Message-ID: Hey folks. I'm looking for a developer to help out on a rather large Rails application. Please reply directly to me if you have experience, are interested, or know someone like that. Adam From brentmc79 at gmail.com Mon Dec 14 19:08:18 2009 From: brentmc79 at gmail.com (Brent Collier) Date: Mon, 14 Dec 2009 19:08:18 -0500 Subject: [raleigh.rb] Intridea is hiring! Message-ID: Fyi, Intridea is seeking an experienced Rails developer to join our remote development team. Candidates must have recent and relevant Rails experience, as well as strong HTML, CSS, and Javascript skills. Join a great team that loves coding and gets stuff done. Please email jobs at intridea.com with a resume, github link, and any other relevant details. -- Brent Collier | 919.564.6915 | www.BrentCollier.com | www.brentmc79.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at 37signals.com Tue Dec 15 13:15:23 2009 From: mark at 37signals.com (Mark Imbriaco) Date: Tue, 15 Dec 2009 13:15:23 -0500 Subject: [raleigh.rb] Pre-meeting grub? Message-ID: What's the plan for pre-meeting food this month? I know there's talk about treats during the meeting, but are folks planning to meet for dinner before the meeting as normal? -Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available URL: From duff at omelia.org Tue Dec 15 13:32:23 2009 From: duff at omelia.org (Duff OMelia) Date: Tue, 15 Dec 2009 13:32:23 -0500 Subject: [raleigh.rb] Pre-meeting grub? In-Reply-To: References: Message-ID: <812ef9f0912151032o7b372cbaw4c7e4d24604acee8@mail.gmail.com> > What's the plan for pre-meeting food this month? ?I know there's talk about treats during the meeting, > but are folks planning to meet for dinner before the meeting as normal? I'm interested in getting food beforehand too. I'm up for anywhere. --------------------------------------------------- Duff OMelia From nathaniel at talbott.ws Tue Dec 15 15:15:23 2009 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Tue, 15 Dec 2009 15:15:23 -0500 Subject: [raleigh.rb] Pre-meeting grub? In-Reply-To: References: Message-ID: <4ce336a20912151215l36146b92x2cdd7fb7f14b0eff@mail.gmail.com> On Tue, Dec 15, 2009 at 1:15 PM, Mark Imbriaco wrote: > What's the plan for pre-meeting food this month? ?I know there's talk about treats > during the meeting, but are folks planning to meet for dinner before the meeting as normal? Sorry - busy day! Pre-meeting chow is definitely on, we'll do it at 5:30 as usual at Ruckus Pizza. See ya'll there... -- Nathaniel Talbott <:((>< From ahwatts at gmail.com Tue Dec 15 15:34:31 2009 From: ahwatts at gmail.com (Andrew Watts) Date: Tue, 15 Dec 2009 15:34:31 -0500 Subject: [raleigh.rb] Error install MySQL gem Message-ID: I'm getting the following error trying to install the MySQL gem on a FC9 machine: === dolly ~ # gem install mysql Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /usr/local/ruby-1.8.6-p369/bin/ruby extconf.rb checking for mysql_ssl_set()... no checking for rb_str_set_len()... no checking for rb_thread_start_timer()... no checking for mysql.h... yes creating Makefile make gcc -m32 -I. -I. -I/usr/local/ruby-1.8.6-p369/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -g -O2 -c mysql.c gcc -m32 -shared -o mysql_api.so mysql.o -L. -L/usr/local/ruby-1.8.6-p369/lib -Wl,-R/usr/local/ruby-1.8.6-p369/lib -L. -rdynamic -Wl,-export-dynamic -rdynamic -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto -lrt -ldl -lcrypt -lm -lc /usr/bin/ld: skipping incompatible /usr/lib64/mysql/libmysqlclient.so when searching for -lmysqlclient /usr/bin/ld: skipping incompatible /usr/lib64/mysql/libmysqlclient.a when searching for -lmysqlclient /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make: *** [mysql_api.so] Error 1 Gem files will remain installed in /usr/local/ruby-1.8.6-p369/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection. Results logged to /usr/local/ruby-1.8.6-p369/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out === As you can see, I'm trying to build a 32-bit MySQL gem to match my 32-bit built Ruby. The system has a mixed 32 / 64 bit libraries, with the 32-bit ones in /usr/lib and the 64-bit ones in /usr/lib64. So far, mostly standard stuff. However, mkmf.rb seems to always be including -L/usr/lib64 in the command line to link the .so together. I can't seem to figure out how to persuade mkmf.rb to use /usr/lib instead of /usr/lib64 when linking. Any ideas? Thanks, Andrew Watts ahwatts at gmail.com From ahwatts at gmail.com Tue Dec 15 16:01:03 2009 From: ahwatts at gmail.com (Andrew Watts) Date: Tue, 15 Dec 2009 16:01:03 -0500 Subject: [raleigh.rb] Error install MySQL gem In-Reply-To: References: Message-ID: Okay. I think I fixed it myself. The problem was that the OS installed the 64-bit MySQL RPMs, and I'd also installed the 32-bit MySQL client library RPMs. The OS's mysql_config file was telling mkmf.rb to use /usr/lib64, as that would be how to talk to the default MySQL installation, but I didn't want that. The solution was to tell extconf.rb to ignore mysql_config and specify my own library directory: gem install mysql -- --without-mysql-config --with-mysql-lib=/usr/lib/mysql Ugh. On Tue, Dec 15, 2009 at 3:34 PM, Andrew Watts wrote: > I'm getting the following error trying to install the MySQL gem on a > FC9 machine: > > === > > dolly ~ # gem install mysql > Building native extensions. ?This could take a while... > ERROR: ?Error installing mysql: > ? ? ? ?ERROR: Failed to build gem native extension. > > /usr/local/ruby-1.8.6-p369/bin/ruby extconf.rb > checking for mysql_ssl_set()... no > checking for rb_str_set_len()... no > checking for rb_thread_start_timer()... no > checking for mysql.h... yes > creating Makefile > > make > gcc -m32 -I. -I. > -I/usr/local/ruby-1.8.6-p369/lib/ruby/1.8/x86_64-linux -I. > -DHAVE_MYSQL_H ?-D_FILE_OFFSET_BITS=64 -I/usr/include/mysql ?-g -pipe > -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector > --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 > -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -g -O2 ?-c > mysql.c > gcc -m32 -shared -o mysql_api.so mysql.o -L. > -L/usr/local/ruby-1.8.6-p369/lib -Wl,-R/usr/local/ruby-1.8.6-p369/lib > -L. ?-rdynamic -Wl,-export-dynamic ? ?-rdynamic -L/usr/lib64/mysql > -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto ?-lrt > -ldl -lcrypt -lm ? -lc > /usr/bin/ld: skipping incompatible /usr/lib64/mysql/libmysqlclient.so > when searching for -lmysqlclient > /usr/bin/ld: skipping incompatible /usr/lib64/mysql/libmysqlclient.a > when searching for -lmysqlclient > /usr/bin/ld: cannot find -lmysqlclient > collect2: ld returned 1 exit status > make: *** [mysql_api.so] Error 1 > > > Gem files will remain installed in > /usr/local/ruby-1.8.6-p369/lib/ruby/gems/1.8/gems/mysql-2.8.1 for > inspection. > Results logged to > /usr/local/ruby-1.8.6-p369/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out > > === > > As you can see, I'm trying to build a 32-bit MySQL gem to match my > 32-bit built Ruby. ?The system has a mixed 32 / 64 bit libraries, with > the 32-bit ones in /usr/lib and the 64-bit ones in /usr/lib64. ?So > far, mostly standard stuff. ?However, mkmf.rb seems to always be > including -L/usr/lib64 in the command line to link the .so together. > I can't seem to figure out how to persuade mkmf.rb to use /usr/lib > instead of /usr/lib64 when linking. ?Any ideas? > > Thanks, > > Andrew Watts > ahwatts at gmail.com > From kevin.olbrich at gmail.com Thu Dec 17 11:19:19 2009 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Thu, 17 Dec 2009 11:19:19 -0500 Subject: [raleigh.rb] sysadmin/DBA openings at iContact Message-ID: There are several system administrator and database administrator positions open at iContact. If you know a lot about Debian, MySql, virtualization, or network infrastructure and you are interested in working for a fun and growing company, drop me a line. These jobs have not yet hit our careers page ( http://www.icontact.com/about/careers). On a related note, iContact is going to be looking to fill 10+ positions in our technology department in the near future. -Kevin Olbrich -------------- next part -------------- An HTML attachment was scrubbed... URL: From duff at omelia.org Thu Dec 17 12:22:10 2009 From: duff at omelia.org (Duff OMelia) Date: Thu, 17 Dec 2009 12:22:10 -0500 Subject: [raleigh.rb] The book exchange Message-ID: <812ef9f0912170922n4c350d4aw9885dbbd3de0f1fc@mail.gmail.com> One of the books I received the other night was The Well-Grounded Rubyist by David A. Black. I've been pleasantly surprised by it. I thought I'd mention it in case any of y'all might benefit. http://duffomelia.com/blog/2009/12/17/the-well-grounded-rubyist --------------------------------------------------- Duff OMelia From pelargir at gmail.com Mon Dec 28 12:56:31 2009 From: pelargir at gmail.com (Matthew Bass) Date: Mon, 28 Dec 2009 12:56:31 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? Message-ID: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> Rails question: I have a "has_many through" association and I've noticed that when I create a new record, validation gets triggered on the targets of the through model. This is undesirable in my view since I'm wanting to establish a relationship between two models... I don't really care if one or the other is valid. I'd at least like to have some control over whether validation runs or not. Here's the situation: class Hospital < ActiveRecord::Base has_many :surgeons, :through => :hospital_surgeons has_many :hospital_surgeons end class HospitalSurgeon belongs_to :hospital belongs_to :surgeon end class Surgeon # validates some stuff end I create a new instance of a Hospital and assign existing surgeon IDs to it: hospital = Hospital.new hospital.surgeon_ids = ["1", "2", "3"] hospital.save This works fine when the surgeons are all valid, but the save fails if any one of the surgeons are invalid. (Keep in mind that these are surgeons that already exist, they are just in an invalid state either through a direct database update or because the data in them predates the validation.) This seems wrong. I want to save the association between the hospital and the surgeons, regardless of whether or not the surgeons are valid. Has anyone else experienced this? Any ideas? Matthew From mark.bennett.mail at gmail.com Mon Dec 28 13:03:23 2009 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Mon, 28 Dec 2009 13:03:23 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> Message-ID: save! Mark On Mon, Dec 28, 2009 at 12:56 PM, Matthew Bass wrote: > Rails question: I have a "has_many through" association and I've noticed > that when I create a new record, validation gets triggered on the targets of > the through model. This is undesirable in my view since I'm wanting to > establish a relationship between two models... I don't really care if one or > the other is valid. I'd at least like to have some control over whether > validation runs or not. > > Here's the situation: > > class Hospital < ActiveRecord::Base > has_many :surgeons, :through => :hospital_surgeons > has_many :hospital_surgeons > end > > class HospitalSurgeon > belongs_to :hospital > belongs_to :surgeon > end > > class Surgeon > # validates some stuff > end > > I create a new instance of a Hospital and assign existing surgeon IDs to > it: > > hospital = Hospital.new > hospital.surgeon_ids = ["1", "2", "3"] > hospital.save > > This works fine when the surgeons are all valid, but the save fails if any > one of the surgeons are invalid. (Keep in mind that these are surgeons that > already exist, they are just in an invalid state either through a direct > database update or because the data in them predates the validation.) > > This seems wrong. I want to save the association between the hospital and > the surgeons, regardless of whether or not the surgeons are valid. > > Has anyone else experienced this? Any ideas? > > Matthew > > _______________________________________________ > 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: From info at lojic.com Mon Dec 28 13:14:34 2009 From: info at lojic.com (Brian Adkins) Date: Mon, 28 Dec 2009 13:14:34 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> Message-ID: <4B38F58A.4050903@lojic.com> Matthew Bass wrote, On 12/28/09 12:56 PM: > Rails question: I have a "has_many through" association and I've noticed that when I create a new record, validation gets triggered on the targets of the through model. This is undesirable in my view since I'm wanting to establish a relationship between two models... I don't really care if one or the other is valid. I'd at least like to have some control over whether validation runs or not. > > Here's the situation: > > class Hospital < ActiveRecord::Base > has_many :surgeons, :through => :hospital_surgeons > has_many :hospital_surgeons > end > > class HospitalSurgeon > belongs_to :hospital > belongs_to :surgeon > end > > class Surgeon > # validates some stuff > end > > I create a new instance of a Hospital and assign existing surgeon IDs to it: > > hospital = Hospital.new > hospital.surgeon_ids = ["1", "2", "3"] > hospital.save > > This works fine when the surgeons are all valid, but the save fails if any one of the surgeons are invalid. (Keep in mind that these are surgeons that already exist, they are just in an invalid state either through a direct database update or because the data in them predates the validation.) > > This seems wrong. I want to save the association between the hospital and the surgeons, regardless of whether or not the surgeons are valid. > > Has anyone else experienced this? Any ideas? If you just want to establish the relationship, you could save the Hospital, and then simply create the appropriate HospitalSurgeon objects that map the Hospital to the Surgeon. The save method accepts a boolean to indicate whether to perform validation, but I don't think you want to skip that when saving the Hospital. Brian -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ From redinger at gmail.com Mon Dec 28 13:23:31 2009 From: redinger at gmail.com (Christopher Redinger) Date: Mon, 28 Dec 2009 13:23:31 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> Message-ID: <01685C24-95A4-4F5D-AA1D-283CCEF2F2B5@gmail.com> On Dec 28, 2009, at 12:56 PM, Matthew Bass wrote: > class Hospital < ActiveRecord::Base > has_many :surgeons, :through => :hospital_surgeons > has_many :hospital_surgeons > end has_many :surgeons, :through => :hospital_surgeons, :validate => false -- Christopher Redinger http://agiledisciple.com Agile Ruby and Rails Development (919) 386-9643 From info at lojic.com Mon Dec 28 13:36:38 2009 From: info at lojic.com (Brian Adkins) Date: Mon, 28 Dec 2009 13:36:38 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: <01685C24-95A4-4F5D-AA1D-283CCEF2F2B5@gmail.com> References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> <01685C24-95A4-4F5D-AA1D-283CCEF2F2B5@gmail.com> Message-ID: <4B38FAB6.3020708@lojic.com> Christopher Redinger wrote, On 12/28/09 1:23 PM: > On Dec 28, 2009, at 12:56 PM, Matthew Bass wrote: >> class Hospital < ActiveRecord::Base >> has_many :surgeons, :through => :hospital_surgeons >> has_many :hospital_surgeons >> end > > has_many :surgeons, :through => :hospital_surgeons, :validate => false This seems like a good solution to the specific use case Matthew mentioned. I wonder whether there are scenarios where he might want the validation though, such as where a new surgeon is being added vs. just wanting to connect an existing one to a hospital. Of course it doesn't seem like you'd ever want invalid surgeons in the database anyway, so there's probably a few things I'm missing. Brian -- Brian Adkins Lojic Technologies, LLC http://lojic.com/ From mark.bennett.mail at gmail.com Mon Dec 28 13:43:21 2009 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Mon, 28 Dec 2009 13:43:21 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> Message-ID: I suppose I meant save(false). You could then check for validation messages on the models that you care about and ignore the others. Mark On Mon, Dec 28, 2009 at 1:03 PM, Mark Bennett wrote: > save! > > Mark > > > On Mon, Dec 28, 2009 at 12:56 PM, Matthew Bass wrote: > >> Rails question: I have a "has_many through" association and I've noticed >> that when I create a new record, validation gets triggered on the targets of >> the through model. This is undesirable in my view since I'm wanting to >> establish a relationship between two models... I don't really care if one or >> the other is valid. I'd at least like to have some control over whether >> validation runs or not. >> >> Here's the situation: >> >> class Hospital < ActiveRecord::Base >> has_many :surgeons, :through => :hospital_surgeons >> has_many :hospital_surgeons >> end >> >> class HospitalSurgeon >> belongs_to :hospital >> belongs_to :surgeon >> end >> >> class Surgeon >> # validates some stuff >> end >> >> I create a new instance of a Hospital and assign existing surgeon IDs to >> it: >> >> hospital = Hospital.new >> hospital.surgeon_ids = ["1", "2", "3"] >> hospital.save >> >> This works fine when the surgeons are all valid, but the save fails if any >> one of the surgeons are invalid. (Keep in mind that these are surgeons that >> already exist, they are just in an invalid state either through a direct >> database update or because the data in them predates the validation.) >> >> This seems wrong. I want to save the association between the hospital and >> the surgeons, regardless of whether or not the surgeons are valid. >> >> Has anyone else experienced this? Any ideas? >> >> Matthew >> >> _______________________________________________ >> 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: From pelargir at gmail.com Mon Dec 28 16:12:31 2009 From: pelargir at gmail.com (Matthew Bass) Date: Mon, 28 Dec 2009 16:12:31 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: <01685C24-95A4-4F5D-AA1D-283CCEF2F2B5@gmail.com> References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> <01685C24-95A4-4F5D-AA1D-283CCEF2F2B5@gmail.com> Message-ID: <5AE762C3-7B71-4278-AAFB-2E97406A056B@gmail.com> On Dec 28, 2009, at 1:23 PM, Christopher Redinger wrote: > has_many :surgeons, :through => :hospital_surgeons, :validate => false Worked perfectly, thanks! Matthew From rick.denatale at gmail.com Mon Dec 28 18:58:24 2009 From: rick.denatale at gmail.com (Rick DeNatale) Date: Mon, 28 Dec 2009 18:58:24 -0500 Subject: [raleigh.rb] Creating through model triggers validation on targets? In-Reply-To: <4B38FAB6.3020708@lojic.com> References: <477F24C9-AEB5-4201-B5F0-811D1A9373A8@gmail.com> <01685C24-95A4-4F5D-AA1D-283CCEF2F2B5@gmail.com> <4B38FAB6.3020708@lojic.com> Message-ID: On Mon, Dec 28, 2009 at 1:36 PM, Brian Adkins wrote: > I wonder whether there are scenarios where he might want the validation > though, such as where a new surgeon is being added vs. just wanting to > connect an existing one to a hospital. Of course it doesn't seem like you'd > ever want invalid surgeons in the database anyway, so there's probably a few > things I'm missing. Well, most hospitals are FULL of invalids, maybe some of them are surgeons! -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale From kevin at hypotheticalabs.com Tue Dec 29 16:09:38 2009 From: kevin at hypotheticalabs.com (Kevin A. Smith) Date: Tue, 29 Dec 2009 16:09:38 -0500 Subject: [raleigh.rb] For Sale: Lego Mindstorms Message-ID: <41245789-0C95-42E5-B17D-9A9B9A39B3D7@hypotheticalabs.com> All - As we do the yearly toy rotation boogie here at Chez Smith I've come across my old Mindstorm NXT set. I bought them back in 2007 thinking I'd have time to experiment with them. Sadly, they have languished these past two years. The set is complete minus the original packaging. All parts have been sorted into a couple of small Rubbermaid bins for ease of use. Asking price is $100 OBO. Thanks, Kevin From jeremymcanally at gmail.com Tue Dec 29 16:22:45 2009 From: jeremymcanally at gmail.com (Jeremy McAnally) Date: Tue, 29 Dec 2009 15:22:45 -0600 Subject: [raleigh.rb] For Sale: Lego Mindstorms In-Reply-To: <41245789-0C95-42E5-B17D-9A9B9A39B3D7@hypotheticalabs.com> References: <41245789-0C95-42E5-B17D-9A9B9A39B3D7@hypotheticalabs.com> Message-ID: Would you be willing to ship it? I work with a FIRST Lego League team here and they're pretty underprivileged; we'd love to get this off you for use in training/next year's competition. --Jeremy On Tue, Dec 29, 2009 at 3:09 PM, Kevin A. Smith wrote: > All - > > As we do the yearly toy rotation boogie here at Chez Smith I've come across my old Mindstorm NXT set. I bought them back in 2007 thinking I'd have time to experiment with them. Sadly, they have languished these past two years. > > The set is complete minus the original packaging. All parts have been sorted into a couple of small Rubbermaid bins for ease of use. Asking price is $100 OBO. > > Thanks, > Kevin > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- http://jeremymcanally.com/ http://entp.com/ http://omgbloglol.com My books: http://manning.com/mcanally/ http://humblelittlerubybook.com/ (FREE!) From kevin at hypotheticalabs.com Tue Dec 29 16:28:09 2009 From: kevin at hypotheticalabs.com (Kevin A. Smith) Date: Tue, 29 Dec 2009 16:28:09 -0500 Subject: [raleigh.rb] For Sale: Lego Mindstorms In-Reply-To: References: <41245789-0C95-42E5-B17D-9A9B9A39B3D7@hypotheticalabs.com> Message-ID: <16DBCEAD-F800-4628-AEF6-B7C593083528@hypotheticalabs.com> Sure. Contact me off list and we can work out the particulars. --Kevin On Dec 29, 2009, at 4:22 PM, Jeremy McAnally wrote: > Would you be willing to ship it? I work with a FIRST Lego League team > here and they're pretty underprivileged; we'd love to get this off you > for use in training/next year's competition. > > --Jeremy > > On Tue, Dec 29, 2009 at 3:09 PM, Kevin A. Smith > wrote: >> All - >> >> As we do the yearly toy rotation boogie here at Chez Smith I've come across my old Mindstorm NXT set. I bought them back in 2007 thinking I'd have time to experiment with them. Sadly, they have languished these past two years. >> >> The set is complete minus the original packaging. All parts have been sorted into a couple of small Rubbermaid bins for ease of use. Asking price is $100 OBO. >> >> Thanks, >> Kevin >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> > > > > -- > http://jeremymcanally.com/ > http://entp.com/ > http://omgbloglol.com > > My books: > http://manning.com/mcanally/ > http://humblelittlerubybook.com/ (FREE!) > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members