activerecord-mysql-awesome 0.0.8 → 0.0.9

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: f1acaa010a9b8247e4da71e4db46c785d41b08ac
4
- data.tar.gz: 91cba5093474fa74a80f6dc11f6297a290488bfc
3
+ metadata.gz: 62e622fc5e46035d940733c14a5ba2aa6f07c79f
4
+ data.tar.gz: 3bf808130042d45f898ca784074ef1b4050d20c5
5
5
  SHA512:
6
- metadata.gz: 14c3110d365ad43ef7f21a24620bbd1ea79e59d89439c425be74a3bdc646b7e3657dbbbc2c3d070c814eb96e63d433f4cec96c1b379fa64ee8e85f96e739b2a8
7
- data.tar.gz: 12725c84a1d598c87435a2b68ff6056d831b4648e3e91ef5d10f3f441386c8b274c7965c27d1ada86afd4ca239890e1d8dba523c004603a097663b128de83816
6
+ metadata.gz: 72101340cf2940dc17ec488bdf17e3fb0ab92def22d7c7960ae14282cdf5a21b808c36075ff4a334c7494e406b8b56cdacfdd1e6b70dc96c38330aa801766d10
7
+ data.tar.gz: ff8a944009cf786aee4b4779e661af4be369f77b9c00a56c3371928449661b29d6865197d9f54349d3941708c87adafc1b04f94c884390e65338736c439e5884
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "activerecord", "~> #{ENV['AR_VERSION']}" if ENV['AR_VERSION']
4
+ gem "mysql2", "~> 0.3.18"
4
5
 
5
6
  # Specify your gem's dependencies in activerecord-mysql-awesome.gemspec
6
7
  gemspec
@@ -209,7 +209,7 @@ module ActiveRecord
209
209
  public
210
210
 
211
211
  def supports_datetime_with_precision?
212
- (version[0] == 5 && version[1] >= 6) || version[0] >= 6
212
+ version >= '5.6.4'
213
213
  end
214
214
 
215
215
  def type_to_sql(type, limit = nil, precision = nil, scale = nil, unsigned = false)
@@ -0,0 +1,27 @@
1
+ require 'active_record/connection_adapters/mysql2_adapter'
2
+
3
+ module ActiveRecord
4
+ module ConnectionAdapters
5
+ class Mysql2Adapter < AbstractMysqlAdapter
6
+ class Version
7
+ include Comparable
8
+
9
+ def initialize(version_string)
10
+ @version = version_string.split('.').map(&:to_i)
11
+ end
12
+
13
+ def <=>(version_string)
14
+ @version <=> version_string.split('.').map(&:to_i)
15
+ end
16
+
17
+ def [](index)
18
+ @version[index]
19
+ end
20
+ end
21
+
22
+ def version
23
+ @version ||= Version.new(@connection.server_info[:version].match(/^\d+\.\d+\.\d+/)[0])
24
+ end
25
+ end
26
+ end
27
+ end
@@ -2,6 +2,7 @@ if ActiveRecord::VERSION::MAJOR == 4
2
2
  require 'activerecord-mysql-awesome/active_record/schema_dumper'
3
3
  require 'activerecord-mysql-awesome/active_record/connection_adapters/abstract/schema_dumper'
4
4
  require 'activerecord-mysql-awesome/active_record/connection_adapters/abstract_mysql_adapter'
5
+ require 'activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter'
5
6
  else
6
7
  raise "activerecord-mysql-awesome supports activerecord ~> 4.x"
7
8
  end
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module Mysql
3
3
  module Awesome
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
6
6
  end
7
7
  end
@@ -83,7 +83,7 @@ class DateTimePrecisionTest < ActiveRecord::TestCase
83
83
  def test_datetime_column_with_default_in_string_works
84
84
  @connection.create_table(:foos, force: true)
85
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')
86
+ assert_match %r{2015-01-02 03:04:05}, activerecord_column_option('foos', 'default_at', 'default').to_s
87
87
  end
88
88
 
89
89
  private
@@ -39,8 +39,7 @@ def current_adapter?(*types)
39
39
  end
40
40
 
41
41
  def mysql_56?
42
- current_adapter?(:Mysql2Adapter) &&
43
- ActiveRecord::Base.connection.send(:version).join(".") >= "5.6.0"
42
+ current_adapter?(:Mysql2Adapter) && ActiveRecord::Base.connection.version >= "5.6.0"
44
43
  end
45
44
 
46
45
  # FIXME: we have tests that depend on run order, we should fix that and
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-mysql-awesome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryuta Kamizono
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-23 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,6 +97,7 @@ files:
97
97
  - lib/activerecord-mysql-awesome.rb
98
98
  - lib/activerecord-mysql-awesome/active_record/connection_adapters/abstract/schema_dumper.rb
99
99
  - lib/activerecord-mysql-awesome/active_record/connection_adapters/abstract_mysql_adapter.rb
100
+ - lib/activerecord-mysql-awesome/active_record/connection_adapters/mysql2_adapter.rb
100
101
  - lib/activerecord-mysql-awesome/active_record/schema_dumper.rb
101
102
  - lib/activerecord/mysql/awesome.rb
102
103
  - lib/activerecord/mysql/awesome/base.rb
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  version: '0'
140
141
  requirements: []
141
142
  rubyforge_project:
142
- rubygems_version: 2.4.5
143
+ rubygems_version: 2.6.4
143
144
  signing_key:
144
145
  specification_version: 4
145
146
  summary: Awesome patches backported for ActiveRecord MySQL adapters