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: bcb6bbe01ddf851d0cc7d105dbaa118dec5a7dd6
4
- data.tar.gz: 2725be6b893041946c54305e87d750bbe19f971a
3
+ metadata.gz: ee402a651d9ecc1a16babc8b27eb4705582e708a
4
+ data.tar.gz: 42cc9907cfb8218eb57cd65dde847b69e38239d2
5
5
  SHA512:
6
- metadata.gz: 19e8bd36fa0348b7ea44713de4fe3ffe4caec169fca4c2d3bdcf70267ecaa53fb653b198a51958a0a8c1b1c6b1d87aa8d372c82458890b6983c6baeb920d0e09
7
- data.tar.gz: b612ba760ca2456228f5f42fe6314dc478d9e3136ca311fcc0aa209450d2dcf8b9852335730b48ff10a79f55362c139658a0ffc0119dd78e2f3d15f24058087c
6
+ metadata.gz: 83ab3a39c7d2ff57a82e00ee4af84c19c58ab42f22d016ed5a942367ff50a8c3d15e1f86af9c766049b1c2be25cdc00a47e8c15775d66a525c59b7d81521750c
7
+ data.tar.gz: b416da5f23016c73607f6b142c77cc2a5218bacd41c58aa41864c568a1a15058b2dd0ce03b6863da2a6c02b38dc360c87677bbc813a9afa3b0df8f5b2639c599
@@ -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)
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module Mysql
3
3
  module Awesome
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  end
6
6
  end
7
7
  end
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-mysql-awesome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryuta Kamizono