rails_compatibility 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +0 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +0 -0
- data/CHANGELOG.md +7 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/LICENSE +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +1 -1
- data/Rakefile +0 -0
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/gemfiles/3.2.gemfile +0 -0
- data/gemfiles/4.2.gemfile +0 -0
- data/gemfiles/5.0.gemfile +0 -0
- data/gemfiles/5.1.gemfile +0 -0
- data/gemfiles/5.2.gemfile +0 -0
- data/gemfiles/6.0.gemfile +0 -0
- data/gemfiles/6.1.gemfile +0 -0
- data/lib/rails_compatibility.rb +0 -0
- data/lib/rails_compatibility/active_record.rb +0 -0
- data/lib/rails_compatibility/attribute_types.rb +0 -0
- data/lib/rails_compatibility/build_joins.rb +0 -0
- data/lib/rails_compatibility/construct_join_dependency.rb +12 -6
- data/lib/rails_compatibility/unscope_where.rb +0 -0
- data/lib/rails_compatibility/version.rb +1 -1
- data/rails_compatibility.gemspec +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d628f314ad4219a50d3f0d4a72b69254ae956c1d1e63a0db6870143ceba6ffd
|
4
|
+
data.tar.gz: c5e489ed0997e8d8dfab6828c24d4d8c513e2c9aaa0a12a0d858db0cf3b224c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25c8eaa141e7dcf885ea0a3640032686092c4779f8382d76b8da9d1744359924d6b805e8b52b723ccbfc0cd6f9783765f88723e1071d891604a4573ea7907363
|
7
|
+
data.tar.gz: d7346c65e318fc062248678ce9e9e2d9200ad86bbd0eee6395afba7720127267b85ca53bbf8ebe5066a3fdc65db6fc78cd85ea7fe1475c9a15b74c990f8014e8
|
data/.github/workflows/ruby.yml
CHANGED
File without changes
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
File without changes
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Change Log
|
2
2
|
|
3
|
+
### [v0.0.3](https://github.com/khiav223577/rails_compatibility/compare/v0.0.2...v0.0.3) 2021/02/09
|
4
|
+
- [#7](https://github.com/khiav223577/rails_compatibility/pull/7) Implement #build_joins (@khiav223577)
|
5
|
+
- [#6](https://github.com/khiav223577/rails_compatibility/pull/6) Support Rails 6.1 (@khiav223577)
|
6
|
+
- [#5](https://github.com/khiav223577/rails_compatibility/pull/5) Migrating from Travis CI to GitHub Actions (@khiav223577)
|
7
|
+
- [#4](https://github.com/khiav223577/rails_compatibility/pull/4) Fix: test files should not be included in coverage (@khiav223577)
|
8
|
+
- [#3](https://github.com/khiav223577/rails_compatibility/pull/3) Support Ruby 2.7 (@khiav223577)
|
9
|
+
|
3
10
|
### [v0.0.2](https://github.com/khiav223577/rails_compatibility/compare/v0.0.1...v0.0.2) 2019/12/18
|
4
11
|
- [#2](https://github.com/khiav223577/rails_compatibility/pull/2) Implement `attribute_types` (@khiav223577)
|
5
12
|
|
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# RailsCompatibility
|
2
2
|
|
3
3
|
[![Gem Version](https://img.shields.io/gem/v/rails_compatibility.svg?style=flat)](http://rubygems.org/gems/rails_compatibility)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/khiav223577/rails_compatibility/workflows/Ruby/badge.svg)](https://github.com/khiav223577/rails_compatibility/actions)
|
5
5
|
[![RubyGems](http://img.shields.io/gem/dt/rails_compatibility.svg?style=flat)](http://rubygems.org/gems/rails_compatibility)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/khiav223577/rails_compatibility/badges/gpa.svg)](https://codeclimate.com/github/khiav223577/rails_compatibility)
|
7
7
|
[![Test Coverage](https://codeclimate.com/github/khiav223577/rails_compatibility/badges/coverage.svg)](https://codeclimate.com/github/khiav223577/rails_compatibility/coverage)
|
data/Rakefile
CHANGED
File without changes
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
data/gemfiles/3.2.gemfile
CHANGED
File without changes
|
data/gemfiles/4.2.gemfile
CHANGED
File without changes
|
data/gemfiles/5.0.gemfile
CHANGED
File without changes
|
data/gemfiles/5.1.gemfile
CHANGED
File without changes
|
data/gemfiles/5.2.gemfile
CHANGED
File without changes
|
data/gemfiles/6.0.gemfile
CHANGED
File without changes
|
data/gemfiles/6.1.gemfile
CHANGED
File without changes
|
data/lib/rails_compatibility.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -6,14 +6,14 @@ require 'rails_compatibility/active_record'
|
|
6
6
|
class << RailsCompatibility
|
7
7
|
if GTE_RAILS_6_0
|
8
8
|
def construct_join_dependency(reflect, relation)
|
9
|
-
|
10
|
-
return relation.construct_join_dependency(
|
9
|
+
joins = inverse_association_joins(reflect)
|
10
|
+
return relation.construct_join_dependency(joins, Arel::Nodes::InnerJoin)
|
11
11
|
end
|
12
12
|
elsif GTE_RAILS_5_2
|
13
13
|
def construct_join_dependency(reflect, relation)
|
14
|
-
|
14
|
+
joins = inverse_association_joins(reflect)
|
15
15
|
|
16
|
-
join_dependency = ActiveRecord::Associations::JoinDependency.new(reflect.klass, relation.table,
|
16
|
+
join_dependency = ActiveRecord::Associations::JoinDependency.new(reflect.klass, relation.table, joins)
|
17
17
|
|
18
18
|
root = join_dependency.send(:join_root)
|
19
19
|
|
@@ -23,8 +23,14 @@ class << RailsCompatibility
|
|
23
23
|
end
|
24
24
|
else
|
25
25
|
def construct_join_dependency(reflect, _relation)
|
26
|
-
|
27
|
-
return ActiveRecord::Associations::JoinDependency.new(reflect.klass,
|
26
|
+
joins = inverse_association_joins(reflect)
|
27
|
+
return ActiveRecord::Associations::JoinDependency.new(reflect.klass, joins, [])
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def inverse_association_joins(reflect)
|
34
|
+
[reflect.options[:inverse_of] || reflect.active_record.table_name]
|
35
|
+
end
|
30
36
|
end
|
File without changes
|
data/rails_compatibility.gemspec
CHANGED
File without changes
|
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.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khiav reoy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.2.14
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Provides cross-rails methods for you to upgrade rails, backport features,
|