rails_compatibility 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7a818be9a687559746841473b529eca8dec7a850342ca9f943c9528318340e9
4
- data.tar.gz: 4cdcc971d081bf02117c193fb738d4fe2f8d3a2d979a1aeaccf24afa2bf7962d
3
+ metadata.gz: cb1e642696e0bacb7e1a3dc935f6a4d6d9392416520fa4c114e8e72d75df35d7
4
+ data.tar.gz: adc6156b40d3b0c7b142ced5bc29ade09860595460c7ff66a928beb8371ef5a2
5
5
  SHA512:
6
- metadata.gz: 7461f5853dd3c0edac4aa69a5bb3ab4776ea37e04663a2962f8fe555b1718cb8cdaf303ca6117ecad13da7c9fed61392583e93e0286570119a95d000f4798869
7
- data.tar.gz: abae820380d89420793d2147ab836768876022f7ba49f210ac497fb23682227f8257557de03f30c76d4f8251f7eb19c22acde255914773f65334f4f12565021e
6
+ metadata.gz: 1a5df2463304910b45227d8f7d0579aa98bb501fd4bcaebca299271ec8e483edab3198da546a878d6658f345e96db66ca0f1f2b141558aef208d3b9a1c476b12
7
+ data.tar.gz: 625584b400aba33cf595ae0ac887404ea3e9cde1645d5be2add2051ffd413eb01a8ba2990ff78b567be7870b92ed9d8f27d099371f56b8566f7b3d3f3c4c377e
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## Change Log
2
+
3
+ ### v0.0.1 2019/12/17
4
+ - [#1](https://github.com/khiav223577/rails_compatibility/pull/1) Implement `unscope_where` (@khiav223577)
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails_compatibility'
4
+ require 'active_record'
5
+
6
+ class << RailsCompatibility
7
+ if ActiveRecord::Base.respond_to?(:attribute_types) # column_types was changed to attribute_types in Rails 5
8
+ def attribute_types(klass)
9
+ klass.attribute_types
10
+ end
11
+ elsif ActiveRecord::Base.respond_to?(:column_types) # Rails 4
12
+ def attribute_types(klass)
13
+ klass.column_types
14
+ end
15
+ else # In Rails 3
16
+ def attribute_types(klass)
17
+ klass.columns_hash
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsCompatibility
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -1,43 +1,44 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'rails_compatibility/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'rails_compatibility'
8
- spec.version = RailsCompatibility::VERSION
9
- spec.authors = ['khiav reoy']
10
- spec.email = ['mrtmrt15xn@yahoo.com.tw']
11
-
12
- spec.summary = 'Provides cross-rails methods for you to upgrade rails, backport features, create easy-to-maintain gems, and so on.'
13
- spec.description = 'Provides cross-rails methods for you to upgrade rails, backport features, create easy-to-maintain gems, and so on.'
14
- spec.homepage = 'https://github.com/khiav223577/rails_compatibility'
15
- spec.license = 'MIT'
16
-
17
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
- # delete this section to allow pushing this gem to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
- # else
22
- # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
- # end
24
-
25
- spec.files = `git ls-files -z`.split("\x0").reject{|f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = 'exe'
27
- spec.executables = spec.files.grep(%r{^exe/}){|f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
- spec.metadata = {
30
- 'homepage_uri' => 'https://github.com/khiav223577/rails_compatibility',
31
- 'changelog_uri' => 'https://github.com/khiav223577/rails_compatibility/blob/master/CHANGELOG.md',
32
- 'source_code_uri' => 'https://github.com/khiav223577/rails_compatibility',
33
- 'documentation_uri' => 'https://www.rubydoc.info/gems/rails_compatibility',
34
- 'bug_tracker_uri' => 'https://github.com/khiav223577/rails_compatibility/issues',
35
- }
36
-
37
- spec.add_development_dependency 'bundler', '>= 1.17', '< 3.x'
38
- spec.add_development_dependency 'rake', '~> 12.0'
39
- spec.add_development_dependency 'sqlite3', '~> 1.3'
40
- spec.add_development_dependency 'minitest', '~> 5.0'
41
-
42
- spec.add_dependency 'activerecord', '>= 3'
43
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rails_compatibility/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'rails_compatibility'
8
+ spec.version = RailsCompatibility::VERSION
9
+ spec.authors = ['khiav reoy']
10
+ spec.email = ['mrtmrt15xn@yahoo.com.tw']
11
+
12
+ spec.summary = 'Provides cross-rails methods for you to upgrade rails, backport features, create easy-to-maintain gems, and so on.'
13
+ spec.description = 'Provides cross-rails methods for you to upgrade rails, backport features, create easy-to-maintain gems, and so on.'
14
+ spec.homepage = 'https://github.com/khiav223577/rails_compatibility'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ # end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject{|f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{^exe/}){|f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+ spec.metadata = {
30
+ 'homepage_uri' => 'https://github.com/khiav223577/rails_compatibility',
31
+ 'changelog_uri' => 'https://github.com/khiav223577/rails_compatibility/blob/master/CHANGELOG.md',
32
+ 'source_code_uri' => 'https://github.com/khiav223577/rails_compatibility',
33
+ 'documentation_uri' => 'https://www.rubydoc.info/gems/rails_compatibility',
34
+ 'bug_tracker_uri' => 'https://github.com/khiav223577/rails_compatibility/issues',
35
+ }
36
+
37
+ spec.add_development_dependency 'bundler', '>= 1.17', '< 3.x'
38
+ spec.add_development_dependency 'rake', '~> 12.0'
39
+ spec.add_development_dependency 'sqlite3', '~> 1.3'
40
+ spec.add_development_dependency 'minitest', '~> 5.0'
41
+ spec.add_development_dependency 'backports', '~> 3.15.0'
42
+
43
+ spec.add_dependency 'activerecord', '>= 3'
44
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_compatibility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,6 +72,20 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '5.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: backports
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 3.15.0
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 3.15.0
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: activerecord
77
91
  requirement: !ruby/object:Gem::Requirement
@@ -97,6 +111,7 @@ files:
97
111
  - ".gitignore"
98
112
  - ".rubocop.yml"
99
113
  - ".travis.yml"
114
+ - CHANGELOG.md
100
115
  - CODE_OF_CONDUCT.md
101
116
  - LICENSE
102
117
  - LICENSE.txt
@@ -111,6 +126,7 @@ files:
111
126
  - gemfiles/5.2.gemfile
112
127
  - gemfiles/6.0.gemfile
113
128
  - lib/rails_compatibility.rb
129
+ - lib/rails_compatibility/attribute_types.rb
114
130
  - lib/rails_compatibility/unscope_where.rb
115
131
  - lib/rails_compatibility/version.rb
116
132
  - rails_compatibility.gemspec