mycroseconds 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
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 == 'mysql'
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 == 'mysql'
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 == 'mysql'
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mycroseconds}
8
- s.version = "0.1.1"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steve Richert"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mycroseconds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Richert