In Rails 2.1, they added partial updates - which is a great idea and a long time coming. This makes ActiveRecord only updates the parts of a model that has actually changed, and also gives you the ability to see if a field (or a record) has changed since retrieving it from the database. (via mode…
All blog posts tagged with rails
Serialized hashes with partial_updates in Rails 2.1
Rails Deployment
There is a post on RubyInside today that spawned quite the cascade of comments on the topic of deploying rails. While a lot to wade through, there are some interesting comments buried in there. I still find it strange that everyone is clamoring for a solution, while ignoring one that exists because …
CruiseControl and custom cruise tasks running in production
I found a fun gotcha! today with CruiseControl - if you create a custom cruise task you have to set the RAILS_ENV AND ENV["RAILS_ENV"] to test.
If you do not, CruiseControl will run against your production database. Before CruiseControl invokes it's own built-in cruise task it sets the RAILS_ENV to …
Netbeans for the win!
I have been meaning to write an article about netbeans + ruby for awhile, and anyone who knows me has probably heard me talk about it - it's great, it's fast, and it actually just works. However, somebody else saved me the trouble, infrid over at http://lifeonrails.org wrote an epic post about it, …
RSpec/Rails view specs and helpers
I ran into a situation today where I had to mock out a helper method in a view spec. After a bit of poking around came across Jake Scruggs blog where he has a post titled, appropriately enough, Mocking/Stubbing partials and helper methods in RSpec view tests.
For the lazy, it's just:
@controller.te…
RSpec on Rails rake task for Recent Specs
As our number of specs grow I started to miss the test:recent functionality, so I created a simple little rake task to make it work with RSpec. Drop this in lib/tasks, I called it spec_recent.rake.
require 'spec/rake/spectask' # Grab recently touched specs def recent_specs(touched_since) recent_s…
Pluginizing ActionWebService to work on Edge rails
I recently updated a project at work to Edge rails to take advantage of ActiveResource - as a result, ActionWebService went away. We've known for a long time AWS was on it's way out, but I was hoping a plugin version would be created prior to it's removal - which in all fairness may still be the cas…
Enforcing spec coverage with CruiseControl, RCov, and RSpec
Now that Alex has gotten CruiseControl.rb setup setup at work, I wanted to use it to enforce good test coverage - and I wanted the output to look good doing it. Turns out this isn't that hard, but requires a few things:
- CruiseControl.rb up and running
- RSpec and the Rails RSpec plugin
- RCov (gem in…
CodeRay helper for Rails
While I'm using Markdown for formatting blog entries, I wanted to have some decent syntax highlighting support as well. After looking around I decided to use CodeRay. It's fast, customizable, has nice output, and is easy to extend. All I had to do to make it work with Rails was to create a helper. I…
Blog Archives
- December 2008 (2)
- November 2008 (3)
- October 2008 (1)
- September 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (3)
- May 2008 (1)
- April 2008 (1)
- March 2008 (1)
- February 2008 (2)
- January 2008 (2)
- December 2007 (2)
- November 2007 (3)
- October 2007 (1)
- September 2007 (4)
- August 2007 (2)
- June 2007 (3)
- May 2007 (3)
- December 2005 (1)
Recent Comments
- Tasha Bramburger commented on Facebook and ownership of content, December 12, 2008.
- Anonymous commented on ChainReading is back!, December 11, 2008.
- Anonymous commented on Reality Check, Mr. Harper., December 11, 2008.
- Igor Petrushenko commented on Installing ruby mysql gem in OSX 10.5 (Leopard) , December 3, 2008.
- Shawn commented on Viviti enters Open Beta, December 1, 2008.