README in acts_as_readonlyable-0.0.8 vs README in acts_as_readonlyable-0.0.9

- old
+ new

@@ -1,8 +1,8 @@ == Introduction -ActsAsReadonlyable adds support of multiple read-only slave databases to ActiveRecord models. When a model is marked with acts_as_readonlyable, some of AR finders are overridden to run against a slave DB. The supported finders are find, find_by_sql, count_by_sql, find_[all_]by_*, and reload. +ActsAsReadonlyable adds support of multiple read-only slave databases to ActiveRecord models. When a model is marked with acts_as_readonlyable, some of AR finders are overridden to run against a slave DB. The supported finders are find, find_by_sql, count_by_sql, find_[all_]by_*, and calculations. Finders can be forced to fall back to a default DB by passing the :readonly flag set to 'false'. == Disclaimer @@ -52,11 +52,11 @@ r = Fruit.find(:first) # executes against the read_only db r.field = 'value' r.save! # executes against the read_write db -r.reload # executes against the read_only db -r.reload(:readonly => false) # executes against the read_write db +Fruit.count # executes against the read_only db +Fruit.count(:readonly => false) # executes against the read_write db === Transactional Tests Support Since there are two connections established, it breaks transactional tests that rely on the fact that all code lives within a single transaction/connection. To address that, the read only mode is disabled when there is no read-only database configuration entry defined in database.yml. In this case the warning is printed to the log file.