[Rails] Is it possible to serialize the query builder data part of ActiveRecord::Relation and use it later

2013-12-03 Thread Anton Kuzmin
Is it possible to serialize the query builder data part of ActiveRecord::Relation and use it later to query the database with exactly the same query? to_sql is not suitable My task is to have reload a div that contains a list of records got from DB. It can be taken from DB via simple search,

[Rails] Is there a way to prevent an accidental migration from newer version of app to older one?

2013-03-03 Thread Anton Kuzmin
Imagine a rails app that has two versions that developers need to support: 1.0 and 2.0. There are 2 database schemas: app-1, app-2. After fixing a bunch of very important bugs in production (1.0), some junior developer named Bob switches the branch to 2.0 to implement a few features but