Modularized Association Methods in Rails 3.2
Happy Friday! It's Rails 3.2 day! The official release announcement mentions a few of the big changes, but I'd like to take a moment to highlight a relatively small change I was responsible for, one that I hope may make your life a little easier.
From...
Limitless Strings for PostgreSQL
We all love ActiveRecord migrations and the sexy DSL for declaring fields. OK, I don't know if you do, but I sure do.
But life isn't perfect (don't get me started), and there's various details that make using the migration DSL a bit of
a pain.
The one...
Limitless Strings for PostgreSQL
We all love ActiveRecord migrations and the sexy DSL for declaring fields. OK, I don't know if you do, but I sure do.
But life isn't perfect (don't get me started), and there's various details that make using the migration DSL a bit of
a pain.
The one...
May 20, 2010: Fontastic
Book Status Starting to sound repetitive. Still working on the Cuke chapter, this time focusing on cleaning up the parts where I recommend ways to use Cucumber. Still hoping for a beta early next week. Other things This week in Yehuda, there’s a very long article about text encodings and what problems they have, and...
Double Shot #523
There’s early and then there’s insanely early.
master_slave_adapter – Nice approach to doing master-slave databases in Active Record through a custom adapter that dispatches the database calls.
Online Viewstate Viewer / Decoder for Asp.Net 2.0 – I didn’t think I’d need this sort of thing any more. I was wrong.
looksee – Library to examine the method lookup...
ActiveRecord refererential integrity is broken. Let’s fix it!
ActiveRecord supports cascading deletes to preserve referential integrity:
1
2
3
class User
has_many :posts, :dependent => :destroy
end
But you really only want cascading deletes about half the time. The other half, you wa...
Using model constants for project sanity
On one of our larger client projects (approx. 160 models and growing…) we have a specific model that we refer to quite a bit throughout our code. This model contains less than 10 records, but each of them sits on top of an insanely large and complex set of data. Each record refers to a...
Today’s hard-won lesson
An float subtracted from an integer results in a float. When typecast by ActiveRecord, this is converted to an integer.
validates_numericality_of with :only_integer => true results in a rather obscure error message if a non-integer i...
[PLUGIN RELEASE] ActsAsOverflowable
acts_as_overflowableWritten by Nicholas Lega== DESCRIPTION:Allows a column to overflow data into a secondary column if the data size exceeds the character limit. This is useful for fast indexing.Instead of trying to index text blobs, you can specify a ...
[PLUGIN RELEASE] ActsAsSeoFriendly
ActsAsSeoFriendly== DESCRIPTION:Create an SEO friendly field for a model automatically based on a given field.So if you have a Blogs model, and you would like create an SEO friendly versionof the 'title' field, you would just add this to your model and...
Acts As Fast But Very Inaccurate Counter
Introduction
If you have chosen the InnoDB MySQL engine over MyISAM for its support of transactions, foreign keys and other niceties, you might be aware of its limitations, like much slower count(*). Our DBAs are in a constant lookout for slow queries...
Plugin I Cannot Live Without
The Enhanced Rails Migrations plugin was written to end the constant battle we had with clashing names in db migrations within our large development team. We tried everything: special commit policies, rake tasks, even claiming the next migration number...

