kono_utils 0.15.8 → 0.15.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/mysql.rb +8 -6
- data/config/initializers/time.rb +7 -5
- data/lib/kono_utils/engine.rb +5 -0
- data/lib/kono_utils/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a721d40dd86ed11012f88bdf551cd01939911fef
|
4
|
+
data.tar.gz: b7f0b0ab72be491b9a0ac131c6a0346c2236fd97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fc11399099546175691b8b4331f20bf5875ab3c968a1b4a87d27f082fb41e8262272368cc1e2d0eb01fa7eed698fd887e013367e07a8f83b5a412cf774ef49b
|
7
|
+
data.tar.gz: 6eed128978155230d9c4e527c84955e8dda832e54d0acf02db8bcc31a7139c16fcc19fba71a989cd5586d7d7067c520bf2ff1e5ece5c8f8ff3112e6e1e56f2af
|
@@ -1,12 +1,14 @@
|
|
1
1
|
# Creates DATETIME(6) column types by default which support microseconds.
|
2
2
|
#
|
3
3
|
# Without it, only regular (second precise) DATETIME columns are created.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
if defined?(ActiveRecord)
|
5
|
+
module ActiveRecord::ConnectionAdapters
|
6
|
+
if ActiveRecord::Base.connection.instance_of? Mysql2Adapter
|
7
|
+
version = Gem::Version.new(Mysql2::Client.info.fetch(:version))
|
8
|
+
min_vresion = Gem::Version.new('5.6.4')
|
9
|
+
if version>=min_vresion
|
10
|
+
AbstractMysqlAdapter::NATIVE_DATABASE_TYPES[:datetime][:limit] = 6
|
11
|
+
end
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/config/initializers/time.rb
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
|
4
4
|
# Where 6N is the number of places after the decimal (.)
|
5
5
|
# For less precision (eg. miliseconds), change 6N to 3N
|
6
|
-
if
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
if defined?(ActiveRecord)
|
7
|
+
if ActiveRecord::Base.connection.instance_of? ActiveRecord::ConnectionAdapters::Mysql2Adapter
|
8
|
+
version = Gem::Version.new(Mysql2::Client.info.fetch(:version))
|
9
|
+
min_vresion = Gem::Version.new('5.6.4')
|
10
|
+
if version>=min_vresion
|
11
|
+
Time::DATE_FORMATS[:db] = '%Y-%m-%d %H:%M:%S.%6N'
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/kono_utils/engine.rb
CHANGED
@@ -9,5 +9,10 @@ module KonoUtils
|
|
9
9
|
require 'will_paginate-bootstrap'
|
10
10
|
require 'rdiscount'
|
11
11
|
|
12
|
+
|
13
|
+
initializer 'kono_utils.append_views', :group => :all do |app|
|
14
|
+
ActionController::Base.append_view_path KonoUtils::Engine.root.join("app", "views", "kono_utils")
|
15
|
+
end
|
16
|
+
|
12
17
|
end
|
13
18
|
end
|
data/lib/kono_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kono_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
375
375
|
version: '0'
|
376
376
|
requirements: []
|
377
377
|
rubyforge_project:
|
378
|
-
rubygems_version: 2.
|
378
|
+
rubygems_version: 2.4.8
|
379
379
|
signing_key:
|
380
380
|
specification_version: 4
|
381
381
|
summary: Kono Utilities
|
@@ -424,4 +424,3 @@ test_files:
|
|
424
424
|
- spec/lib/kono_utils/fiscal_code_spec.rb
|
425
425
|
- spec/rails_helper.rb
|
426
426
|
- spec/spec_helper.rb
|
427
|
-
has_rdoc:
|