skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Top Posts

planypus

I'm the founder of Planypus, the place to share your plans!

cohesiveft

Accessible, manageable, virtualized application stacks ready to download or deploy to the cloud!

flickr

smokingThe old man and the accordionBicycle 6x6Eva 6x6Shaffies 6x6Phone Booth Velvia 6x6WynnStar 6x6

Archives

Contact

Reach me at yan at pritzker.ws

Posts Tagged RubyOnRails

Rails Tips: Make fixtures play nice with acts_as_paranoid

I was trying to write a test involving deleted items on a project using acts_as_paranoid (which marks objects with a deleted_at date instead of actually deleting them). When I created a fixture with a deleted_at date set, it turns out that making the fixture retrieval call items(:deleted_item) would fail because internally the fixtures use a [...]


Debugging technique for Rails: decode the session cookie

Ever try to debug a problem and needed to see what was inside the user’s session at the time? If you’re using the cookie session store (Rails 2.x), you can now use this tool to take a look:
http://pastie.org/235017
Simply invoke it like this:
DebugTools.show_session(”your long session id goes in here”)
The code deals with linebreaks automatically, so [...]


Testing your ActiveRecord migrations

Sometimes you have a data migration that creates or modifies records in some way, and you would like to test it in your unit tests right? Except that Rails typically just clones the structure of your dev database, not its data. So how do you test that a migration succeeded? Simple, just invoke it during [...]


validates_acceptance_of behavior in Rails 2.0

I noticed that when upgrading to Rails 2.0, my validates_acceptance_of started failing (or rather, it started telling me that my field was not accepted when the param being passed was ‘1′). Apparently I had to add the :accept => true to make it work. I discovered this by reading the Rails source, where it mentions [...]


acts_as_versioned for a set of columns

acts_as_versioned is a great plugin for versioning a set of model attributes transparently every time you save. The plugin seems to be built with exclusion in mind (version all except these) but to get it to work only on a specific set of columns, this simple trick can be applied:
class Foo [:description_t]
def [...]


Clean svn tag support for Capistrano 2

If you find capistrano’s release directory naming conventions hard to use, a great alternative is to base releases on your svn tags. It turns out that implementing this in cap2 is quite simple. Unfortunately I can’t quite figure out how to turn this into a library so at this point it exists as a cut-n-paste [...]


Dynamically adding routes from your engine plugins

At Cohesive FT I am developing a sort of webmin console that has drop-in pluggable components. I am using the RoR plugin system with the engines plugin to drop entire chunks of MVC infrastructure into my application as required. This is all well and good except that rails engines require you to add this line [...]


Rails 1.2 breaks url routing with dots?

This last week we’ve spent migrating Planypus from Rails 1.1.6 to the latest 1.2.1 release. Unfortunately the Rails 1.2 rewrite of the routing system leaves something to be desired. Apparently, the dot “.” (period) character is now considered a route separator, causing routes that have dots in them to break badly. Why is this bad? [...]


Virtual Appliances running a rails admin console

Hello everyone, it’s been a while since I’ve written here mostly because I’ve been super busy at My new job at CohesiveFT. It’s been a fun and hectic several weeks, as I was dumped head first into a brand new environment and technology–building virtual appliances!
We released two new versions of our financial trading appliances [...]


Quick mongrel load testing trick

Zed’s How many mongrels tutorial gives a good idea on how to load test mongrels to determine how many mongrels you should run on your box. Here’s a little trick that makes it easier and quicker to test…
First, set up your mongrel cluster for as many mongrels as you would like to maximally load test. [...]


← Before