Parcourir la source

Merge pull request #1001 from cantino/db_less_strict

Enable `strict: false` in database.yml
Andrew Cantino il y a 9 ans
Parent
commit
2824161d93
2 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 1 1
      app/models/agent_log.rb
  2. 3 0
      config/database.yml

+ 1 - 1
app/models/agent_log.rb

@@ -35,7 +35,7 @@ class AgentLog < ActiveRecord::Base
   protected
 
   def scrub_message
-    if message_changed?
+    if message_changed? && !message.nil?
       self.message = message.inspect unless message.is_a?(String)
       self.message.scrub!{ |bytes| "<#{bytes.unpack('H*')[0]}>" }
     end

+ 3 - 0
config/database.yml

@@ -9,6 +9,7 @@ development:
   host: <%= ENV['DATABASE_HOST'] || "" %>
   port: <%= ENV['DATABASE_PORT'] || "" %>
   socket: <%= ENV['DATABASE_SOCKET'] || ["/var/run/mysqld/mysqld.sock", "/opt/local/var/run/mysql5/mysqld.sock", "/tmp/mysql.sock"].find { |path| File.exist? path } %>
+  strict: false
 
 # Warning: The database defined as "test" will be erased and
 # re-generated from your development database when you run "rake".
@@ -23,6 +24,7 @@ test:
   password:  <%= ENV['DATABASE_PASSWORD'].presence || "" %>
   socket: <%= ENV['DATABASE_SOCKET'] || ["/var/run/mysqld/mysqld.sock", "/opt/local/var/run/mysql5/mysqld.sock", "/tmp/mysql.sock"].find { |path| File.exist? path } %>
   port: <%= ENV['DATABASE_PORT'] || "" %>
+  strict: false
 
 production:
   adapter: <%= ENV['DATABASE_ADAPTER'].presence || "mysql2" %>
@@ -35,3 +37,4 @@ production:
   host: <%= ENV['DATABASE_HOST'] || "" %>
   port: <%= ENV['DATABASE_PORT'] || "" %>
   socket: <%= ENV['DATABASE_SOCKET'] || ["/var/run/mysqld/mysqld.sock", "/opt/local/var/run/mysql5/mysqld.sock", "/tmp/mysql.sock"].find{ |path| File.exist? path } %>
+  strict: false