My Profile Photo

rubycoloredglasses


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


  1. Rails 3 and Subclasses Method

    I was just trying to create coding that reflectively loads the subclasses of a class I’ve defined. The idea is that as new subclasses are added, the script I’m writing can detect which ones are present and inform a remote API that support for a specific API feature is available. …


  2. Locate and Updatedb with Homebrew

    UPDATE: I ran into errors and decided to not use the findutils provided by Homebrew. I simply setup the following alias in .bash_profile and this did the trick. This is using the built in locate database provided with Mac OS X Snow Leopard.


  3. Foreign Key References when Generating Model

    I forget the proper syntax for a model generation command that includes a reference to another models id (foreign key). …


  4. Edit Devise User without Password

    I recently setup a custom controller to edit/update my Admin accounts, which are authenticated using Plataformatec’s Devise gem. …


  5. Factory Girl Not Generating Factories with Scaffold

    I just started a new Rails 3.2 project, and to ensure that the proper test files are generated using Shoulda or Factory_Girl, I’ve installed those gems and configured the application to generate the test files using these gems. …


  6. Ruby Comparison Operator =~

    I saw this in some code recently, wasn’t sure what it did. …


  7. Invalid Gemspec Error Regarding Invalid Date Format

    I installed factory_girl (2.6.0) for a project I am working on recently, and all of a sudden I started getting errors with RubyGems when I would try to run a rake task, such as: …


  8. Deleting Git Branches in Remote Repository

    I had recently used a branch to handle all the modifications I was making to a system for a Rails 3.1 upgrade from Rails 2.4.3. After I merged my changes back into the master branch, I deleted the ‘rails3’ branch locally, but it still remained on the remote server. …


  9. Rails 3 on WHM / cPanel VPS Server

    cPanel is working towards making Rails 3 applications run natively with Passenger, setup via the cPanel interface. I’m not really sure if this will be ideal, as most organizations deploy their apps to the server using Capistrano, not uploading via FTP or something. …


  10. Configuring Rails 3.1.3 under Sub-URI

    In setting up a new Rails app recently I was told that it needed to be served under the sub-URI of ‘/info’. I hadn’t done this before with a Rails app, and I expected that it could be tricky. …