mycroseconds 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/mycroseconds/migration.rb +5 -3
- data/mycroseconds.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Mycroseconds
|
2
2
|
module Migration
|
3
|
+
ADAPTER_NAMES = %w(mysql sqlite)
|
4
|
+
|
3
5
|
module AbstractAdapter
|
4
6
|
def self.included(base)
|
5
7
|
base.class_eval do
|
@@ -11,7 +13,7 @@ module Mycroseconds
|
|
11
13
|
def add_timestamps_with_precision(*args)
|
12
14
|
add_timestamps_without_precision(*args)
|
13
15
|
|
14
|
-
if @base.adapter_name.downcase
|
16
|
+
if ADAPTER_NAMES.include?(@base.adapter_name.downcase)
|
15
17
|
add_column(table_name, :updated_at_precision, :integer, :default => 0, :null => false)
|
16
18
|
end
|
17
19
|
end
|
@@ -19,7 +21,7 @@ module Mycroseconds
|
|
19
21
|
def remove_timestamps_with_precision(*args)
|
20
22
|
remove_timestamps_without_precision(*args)
|
21
23
|
|
22
|
-
if @base.adapter_name.downcase
|
24
|
+
if ADAPTER_NAMES.include?(@base.adapter_name.downcase)
|
23
25
|
remove_column(table_name, :updated_at_precision)
|
24
26
|
end
|
25
27
|
end
|
@@ -35,7 +37,7 @@ module Mycroseconds
|
|
35
37
|
def timestamps_with_precision(*args)
|
36
38
|
timestamps_without_precision(*args)
|
37
39
|
|
38
|
-
if @base.adapter_name.downcase
|
40
|
+
if ADAPTER_NAMES.include?(@base.adapter_name.downcase)
|
39
41
|
column(:updated_at_precision, :integer, :default => 0, :null => false)
|
40
42
|
end
|
41
43
|
end
|
data/mycroseconds.gemspec
CHANGED