Skip to content

Commit 5683946

Browse files
Merge branch 'eliminate_notice_messages'
Closes rails#6754
2 parents 8c02918 + 052e415 commit 5683946

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

activerecord/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Rails 4.0.0 (unreleased) ##
22

3+
* PostgreSQL default log level is now 'warning', to bypass the noisy notice
4+
messages. You can change the log level using the `min_messages` option
5+
available in your config/database.yml.
6+
7+
*kennyj*
8+
39
* Add uuid datatype support to PostgreSQL adapter. *Konstantin Shabanov*
410

511
* `update_attribute` has been removed. Use `update_column` if

activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ def configure_connection
14501450
if @config[:encoding]
14511451
@connection.set_client_encoding(@config[:encoding])
14521452
end
1453-
self.client_min_messages = @config[:min_messages] if @config[:min_messages]
1453+
self.client_min_messages = @config[:min_messages] || 'warning'
14541454
self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]
14551455

14561456
# Use standard-conforming strings if available so we don't have to do the E'...' dance.

activerecord/test/cases/adapters/postgresql/connection_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ def test_encoding
2121
assert_not_nil @connection.encoding
2222
end
2323

24+
def test_default_client_min_messages
25+
assert_equal "warning", @connection.client_min_messages
26+
end
27+
2428
# Ensure, we can set connection params using the example of Generic
2529
# Query Optimizer (geqo). It is 'on' per default.
2630
def test_connection_options

railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ development:
2222
# Minimum log levels, in increasing order:
2323
# debug5, debug4, debug3, debug2, debug1,
2424
# log, notice, warning, error, fatal, and panic
25-
# The server defaults to notice.
26-
#min_messages: warning
25+
# Defaults to warning.
26+
#min_messages: notice
2727

2828
# Warning: The database defined as "test" will be erased and
2929
# re-generated from your development database when you run "rake".

railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ development:
3535
# Minimum log levels, in increasing order:
3636
# debug5, debug4, debug3, debug2, debug1,
3737
# log, notice, warning, error, fatal, and panic
38-
# The server defaults to notice.
39-
#min_messages: warning
38+
# Defaults to warning.
39+
#min_messages: notice
4040

4141
# Warning: The database defined as "test" will be erased and
4242
# re-generated from your development database when you run "rake".

0 commit comments

Comments
 (0)