chuyeow's pings
Sort By:
It’s time again for your weekly dose of what’s new in edge Rails. This weeks’ report covers changes from 14 Jan 2008 to 20 Jan 2008 (the day the Rails Envy podcast was recorded).Route recognition is fasterRails’ route recognition has been optimized and is significantly faster especially for applications using many resources (i.e. via map.resources ...
Edge Rails saw a barrage of refinements and enhancements this week and there’s even talk about Rails 2.1 being just a little around the corner. There’s also been a flurry of contributions to making Rails more thread-safe and performance optimizations (all still work in progress at the moment) - it’s really nice to see how ...
I am not certain whether the ability to retry a code block when encountering exceptions was a feature available in Ruby, but I certainly couldn’t find anything on that topic (what I did find were mostly about the retry keyword for iterator loops).Before you ask why I need this, the motivation for this was because ...
It’s about 9 days too late, but I figure it’d be fun to just throw these out and see if anyone else enjoyed the same things I did in 2007.PC Game of the YearThis has definitely got to go to Call of Duty 4: Modern Warfare. The single-player campaign was short but visually impressive and ...
Yup, it’s time for your weekly dose of the changes on edge Rails, more or less covered in the forthcoming Rails Envy podcast. Using edge Rails is neither arcane nor terrifying, and hopefully weekly reports like these will allow you to take control of your own release schedule with your Rails apps.This week’s report covers ...
Yes, it’s a plug for myself and it’s shameless:Whatever Zed Shaw may say about Rails, Rails has done a huge part in making web development fun again for jaded web developers (first-time web developers probably won’t be able to tell the difference), and more importantly, raising the profile of Ruby more than any other Ruby ...
Gregg Pollack of Rails Envy (the guys behind your favorite Ruby on Rails vs everything commercials) asked me recently whether I could provide them with weekly updates of changes on edge Rails for the Rails Envy Podcast (which is often hilarious besides being informative), seeing as I am already keeping up with developments on the ...
Prior to the introduction of nested example groups in RSpec, I’d always felt that descriptions got a little unwieldy when trying to describe the different cases and disliked specifying the controller_name repeatedly. For example (and these are real examples from real projects at work, with actual code removed for conciseness):describe 'POST HotelDealsController#create …
That’s right, Don’t Repeat Yourself in your functional and ActionMailer tests. If you’re a Test::Unit user, this will probably look familiar to you when writing Rails functional tests (for your controllers):class PostsControllerTest < Test::Unit::TestCase def setup @controller = PostsController.new @request = ActionController::TestRequest.new …
Just in the nick of time for the Christmas target, the Ruby core team has released Ruby 1.9.0 - Matz announced the release on the ruby-talk mailing list not too long ago.Rubygem and Ruby library developers, now’s the time to get down to making your Ruby code compatible with 1.9.0.Rails is not too far from ...
You’d may not have noticed this yet, but Rails 2.0 has a new convenient syntax for generating ActiveRecord migrations. Go ahead, run the migration generator with script/generate migration. I’ll wait.Yup, you can now specify the columns you want to add in your migration by passing attribute/type pairs to the migration generator. Ergo,script/generate migration …
In case anyone is wondering about the pause in Rails 2.0 - a feature a day posts, yes, I know, I’ve not been writing any posts for a week or so. I’ll be posting more actively again from tomorrow - just taking a short break due to general lethargy these few days. And submitting patches ...
Rails 2.0.2 was tagged not too long ago and will hit the gem servers soon I expect. Being a minor point release there aren’t many changes, but here’re the ones I feel are worth mentioning:ActionPack changesConfigurable asset hosts: You can now pass a proc to ActionController::Base.asset_host. This allows you to get by the hard-coded assumption ...
Doing GROUP BYs in ActiveRecord has always been tricky. There’s a lot of “magic” in ActiveRecord and room for untested edge cases. Thankfully, Rails also has a squadron of eagle-eyed contributors who are on hand to fix unforeseen errors.For example, if you wanted to do this:class Click < ActiveRecord::Base belongs_to :site # site_id ...
Today’s (un)feature covers the oft-abused and misunderstood with_scope method. The excellent err.the_blog had a post on how you should be using with_scope (yes, only use it in your ActiveRecord models, not in your controllers or filters). Yes that blog post may have been written a long time back but it’s still applicable to Rails 2.0.With ...
I don’t think I need to explain how concatenating your 5 stylesheets and 12 JavaScript files into single files each makes your webpages load faster. Unless you’re using multiple asset hosts (Rails 2 allows for multiple asset hosts), then it becomes tricky to say for sure which method is better, but I digress.There’re a bunch ...
Google Chart API looks quite useful. I’ve used Gruff to generate graphs before but this looks way easier (and much lighter on the server without all that ImageMagick magic!) I’ll have to play with it someday - if only I didn’t have to mess with those URL params!Well, Deepak Jois from singapore.rb (the local Ruby ...
I know I said I was going to try and keep the features in “a feature a day” to those not mentioned in popular places, but this feature is one of the few nicest features in Rails made by a contributor outside of the Rails core so I couldn’t resist mentioning it.First, an exampleclass CommentsController ...
Time#advance and DateTime#advance just got, erm, more betterer in Rails 2.0.In Rails 1.2.6 and earlier, Time#advance and DateTime#advance only accepted :year, :month and :day options. You’d think :hours, :minutes and :seconds would work too but due to a bug in the code (see ticket #9818), you get something like this instead:Time.utc(2000,10,1,10,30,45).advance(:days …




…