Archive for the 'active record' Category

Base classes get stored by ActiveRecord with type = NULL when using STI…

« 10 January 2008 | 13:53 | active record, rubyonrails | No Comments »

So you make sure you take that into consideration when crafting find_by_sql queries on STI tables.
For example when looking for all but one type in the table:
AND ( g.type != ? OR g.type IS NULL )