My Profile Photo

rubycoloredglasses


I'm Jason, a web applications developer in the San Francisco Bay area.


  1. Updating a Serialized Object from a Web form

    You may run into a situation where you create some sort of standard Ruby class that you want to associate with an ActiveRecord model. The serialize method allows you to store an object inside of a text field for an ActiveRecord object. …


  2. RSpec Controller Tests Receiving 'No route matches' Error

    I’m developing a Rails engine gem for the company I’m working for, which will provide an API for the applications we’re using. The gem I’m creating will be used with a Rails 3.0.9 system, using Rspec-Rails version 2.10.1. I had a route to my API interface setup in the config/routes.rb file like so: …


  3. Cubase Installation Failure

    I recently ran into issues installing Cubase 4 on my Mac running Snow Leopard. I uninstalled Cubase 5 Essential, thinking that this was causing a conflict, and thus stopping me from installing an older version. This wasn’t the case I tried to install Cubase 5 Essential again, and I got the same type of error with it’s installer. I received Cubase 6 in the mail today and tried to install it…only to receive the same type of error: …


  4. Generators Not Working in Rails 2.3.8

    I’m currently working on a gem that is going to use a generator to create files in a Rails 2.3.8 application. One of the applications we’re still using is using Rails 2.3.8, so I have to make a gem compatible with that version of Rails. …


  5. Establishing New Ruby Environment in a Folder using RVM

    I know this is documented on the official RVM website, but I hate having to look it up over and over again each time I want to create a new RVMRC file. …


  6. History of the Canonical Gem Host for Ruby Gems

    The default repository for downloading gems using RubyGems was originally RubyForge.org. This was likely because the RubyGems project was hosted only from RubyForge. This meant that when you ran ‘gem install rails’, your RubyGems installation was configured to download the gem from ‘gems.rubyforge.org’. In August of 2008 Github started gaining popularity amongst the Ruby community after it started providing it’s own gem server via gems.github.com. This resulted in many Ruby developers configuring RubyGems to use the Github server as a secondary source of gems. …


  7. Using Serialize Option with ActiveRecord Objects

    Documentation seems to be more available on how to build forms with check boxes or a multiple select field for ActiveRecord objects that have a has_many or has_many_and_belongs_to association with other ActiveRecord objects. This article shows you how provide a multiple select form based on a custom defined array, with the selected options stored in a single attribute of your ActiveRecord object. …


  8. Save the Tests, Don't Throw Them Away

    So it’s been several weeks since I started using test driven development. I’m using FactoryGirl instead of fixtures, because I’ve heard that fixtures are limiting. I’d rather just write Factories from the beginning. I’m also using standard Test::Unit based unit and functional tests. Haven’t touched on integration testing yet. …


  9. Factory Girl Associations and Records Persisting Across Tests

    I just recently started to adopt test driven development practices. The project I’m working on needs to get done soon, and I didn’t want to get held up learning Rspec. After much consulting with other developers at the company I work for, I had decided to use basic Test::Unit tests with FactoryGirl factories instead of fixtures, and adopt Shoulda if a scenario arises where the options it provides (contexts) are needed. …


  10. Generating Test File Stubs for Existing Models, Views, and Controllers

    I’ve noticed that if you install certain testing gems, like Factory Girl, or Rspec, that your Rails application will create test files for these libraries instead of using the defaults. Even further you can configure the generators used by your Rails app in /config/application.rb …