Blog » Rails

Counting Business Days in Ruby on Rails

In case it’s helpful, here is a simple helper to count business days (as weekdays) going forward in rails.

Migrate Image Files in Paperclip to use id_partition

One of paperclips very cool features is the :id_parition.  By default, ubuntu servers can only store a maxium of 32000 objects in any given directory.  This presents a problem when working with large image sets, like our client GreatAmericanArt’s art catalog.  While our initial server set-up was fine, we migrated to a REE/nginx/passegner set-up on Ubuntu hit this limit.  I wrote the follow ruby script to help migrate from a simple :id asset directory structure to utilizing :id_partition.  It’s pretty basic, but in case it helps anyone out I wanted to put it out there.  Full script after the jump.

Read the rest of this entry »