skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

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.

Get updates by email
Follow me on twitter

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

at the paradeat the parade@slava626@leorazellman and @smazo at bat17my poor ricohyou're wearing my sweaterthe graduatethe answer, my friend

Archives

Contact

Reach me at yan at pritzker.ws

Posts Tagged RubyOnRails

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. [...]


Pretty tree display for all your Rails view partials

If you’re developing an app of significant complexity in Rails, you may start getting lost in a sea of partials. Inspired by an idea by my friend and Planypus developer Alex Antonov, I decided to hack together a little script that does a depth first traversal of all your view files looking for partial calls [...]


Multi column lists using in_groups_of

This code uses the basic technique outlined in this article to split the list up into several lists of a fixed size and then use css to float them into columns.

<% col_size = friends.size/4 %>
<% friends.in_groups_of(col_size) do |group| %>
<div class=‘list‘>
<ul>
<% group.each do |friend| %>
[...]


← Before