activerecord-mysql-awesome 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee402a651d9ecc1a16babc8b27eb4705582e708a
|
4
|
+
data.tar.gz: 42cc9907cfb8218eb57cd65dde847b69e38239d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83ab3a39c7d2ff57a82e00ee4af84c19c58ab42f22d016ed5a942367ff50a8c3d15e1f86af9c766049b1c2be25cdc00a47e8c15775d66a525c59b7d81521750c
|
7
|
+
data.tar.gz: b416da5f23016c73607f6b142c77cc2a5218bacd41c58aa41864c568a1a15058b2dd0ce03b6863da2a6c02b38dc360c87677bbc813a9afa3b0df8f5b2639c599
|
data/lib/activerecord-mysql-awesome/active_record/connection_adapters/abstract_mysql_adapter.rb
CHANGED
@@ -133,7 +133,7 @@ module ActiveRecord
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def quote(value, column = nil)
|
136
|
-
return super if value.nil?
|
136
|
+
return super if value.nil? || !value.acts_like?(:time)
|
137
137
|
return super unless column && /time/ === column.sql_type
|
138
138
|
|
139
139
|
if value.acts_like?(:time)
|
@@ -80,6 +80,12 @@ class DateTimePrecisionTest < ActiveRecord::TestCase
|
|
80
80
|
assert_match %r{t\.datetime\s+"updated_at",\s+precision: 6,\s+null: false$}, output
|
81
81
|
end
|
82
82
|
|
83
|
+
def test_datetime_column_with_default_in_string_works
|
84
|
+
@connection.create_table(:foos, force: true)
|
85
|
+
@connection.add_column :foos, :default_at, :datetime, default: "2015-01-02 03:04:05"
|
86
|
+
assert_equal "2015-01-02 03:04:05", activerecord_column_option('foos', 'default_at', 'default')
|
87
|
+
end
|
88
|
+
|
83
89
|
private
|
84
90
|
|
85
91
|
def database_datetime_precision(table_name, column_name)
|