Skip to content

Commit

Permalink
Change DbCharmer.connections_should_exist default value to true
Browse files Browse the repository at this point in the history
  • Loading branch information
kovyrin committed Apr 5, 2010
1 parent bce2d2e commit e5b5f2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGES
@@ -1,3 +1,9 @@
1.6.4 (2010-04-05):

Default behaviour changed: DbCharmer.connections_should_exist is true in all environments
by default. Old default behaviour was too misleading for many developers.

----------------------------------------------------------------------------------------
1.6.3 (2010-04-03):

Bugfix release: Modified stub connection initialization code to set default connections
Expand Down
8 changes: 4 additions & 4 deletions README.rdoc
Expand Up @@ -127,10 +127,10 @@ Migration class example (global connection rewrite, multiple connections with th
end
end

By default in development and test environments you could skip this <tt>:second_db</tt>
connection from your database.yml files and rails would create the tables in your single database,
but in production you'd specify it and get the table created on a separate server and/or in a
separate database.
By default in all environments <tt>on_db</tt> and <tt>db_magic</tt> statments would fail if
specified connection does not exist in database.yml. It is possible to make +DbCharmer+
ignore such situations in non-production environments so that rails would create the tables
in your single database (especially useful in test databases).

This behaviour is controlled by the <tt>DbCharmer.connections_should_exist</tt>
configuration attribute which could be set from a rails initializer.
Expand Down
2 changes: 1 addition & 1 deletion lib/db_charmer.rb
@@ -1,5 +1,5 @@
module DbCharmer
@@connections_should_exist = Rails.env.production?
@@connections_should_exist = true
mattr_accessor :connections_should_exist

def self.connections_should_exist?
Expand Down

0 comments on commit e5b5f2c

Please sign in to comment.