Take classes and generate SQL (using i_dig_sql gem) to be used in other querys.