In case you’re not a Rails programmer, ActiveRecord has this great ‘convention over configuration’ feature that defines a many to many relationship called the has_many_and_belongs_to association. For example, if you’re mapping many users to many devices, then the join table must named with both tables names (in this cas devices_users). What I didn’t realize until Matt Smith pointed it out is that the order of the names must be alphabetical. The join table cannot be named users_devices. Common sense but thought I would point it out.
This coincides with another (but less obvious) alphabetical caveat I ran into with Rails a while ago: XML nodes in the XML for RESTful posts (for RESTful resources) must be in alphabetical order.
And don’t forget, a column name can’t be named ‘type’ because Rails uses that keyword internally. For single table inheritance, for instance.