search for: bradrobertson

Displaying 3 results from an estimated 3 matches for "bradrobertson".

2011 Sep 13
4
Prepared statements and postgreSQL schemas
Hi guys. I''m using a postgreSQL with multiple schemas. To change between schemas I use the ''SET schema TO ...'' statement. That works ok in rails 3.0. Rails 3.1 uses prepared statements and does not take into account the ''schema_search_path''. This is a big problem because the statement is prepared once and then the same prepared statement is executed
2011 Sep 21
0
hooking into `to_prepare` in a Railtie *after* the files have been reloaded (in dev)
I''m working on a gem <https://github.com/bradrobertson/apartment> that sets properties on ActiveRecord models (such as table_name) dynamically based on a user config option. I have an initializer that achieves this. My problem however is that in dev mode, these classes are reloaded, so they don''t maintain these values set. So I thought...
2011 Sep 13
4
Changing adapters in ActiveRecord does not change the generated sql
...n ActiveRecord base that has to do with the adapter and it doesn''t get cleared when you establish a connection with a new adapter. I know this isn''t standard behaviour, in fact the only reason I need this is because I''m writing a multi-tenancy gem<https://github.com/bradrobertson/apartment>for rails that supports many different database adapters. My tests run through these adapters, but the 2nd adapter to be tested always fails with invalid sql. Here''s an example: ActiveRecord::Base.establish_connection :adapter => ''mysql2'', :database =...