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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b65886e174af9d71e8b04ed12969bc7d9564255eb4deb4dfaa7d2732ad1c3b46
4
- data.tar.gz: f8af6e2aaa5c0dde135b98c054c524571bc06f97e56a29e371ebcb981098d966
3
+ metadata.gz: 0d628f314ad4219a50d3f0d4a72b69254ae956c1d1e63a0db6870143ceba6ffd
4
+ data.tar.gz: c5e489ed0997e8d8dfab6828c24d4d8c513e2c9aaa0a12a0d858db0cf3b224c3
5
5
  SHA512:
6
- metadata.gz: 0dd4cecb90bc3f668577338cff3d9571dc6386757644a9895aa2a2acd157f15faf3e97ee4c9fec60420f161533c2908d796d0fd4b491780b21bae399e6a61c9a
7
- data.tar.gz: e862435b327c9baf0c7087dabf91a3e8079dc67ef833f9a1d12c92595965c4704e3a1aab106bc03ab5eac179e3c5fa840e53344f76fe6efec8dedeb573307167
6
+ metadata.gz: 25c8eaa141e7dcf885ea0a3640032686092c4779f8382d76b8da9d1744359924d6b805e8b52b723ccbfc0cd6f9783765f88723e1071d891604a4573ea7907363
7
+ data.tar.gz: d7346c65e318fc062248678ce9e9e2d9200ad86bbd0eee6395afba7720127267b85ca53bbf8ebe5066a3fdc65db6fc78cd85ea7fe1475c9a15b74c990f8014e8
File without changes
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
+ /gemfiles/*.gemfile.lock
4
5
  /_yardoc/
5
6
  /coverage/
6
7
  /doc/
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://travis-ci.com/khiav223577/rails_compatibility/workflows/Ruby/badge.svg)](https://github.com/khiav223577/rails_compatibility/actions)
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
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
- association_joins = [reflect.active_record.table_name]
10
- return relation.construct_join_dependency(association_joins, Arel::Nodes::InnerJoin)
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
- association_joins = [reflect.active_record.table_name]
14
+ joins = inverse_association_joins(reflect)
15
15
 
16
- join_dependency = ActiveRecord::Associations::JoinDependency.new(reflect.klass, relation.table, association_joins)
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
- association_joins = [reflect.active_record.table_name]
27
- return ActiveRecord::Associations::JoinDependency.new(reflect.klass, association_joins, [])
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
@@ -1,3 +1,3 @@
1
1
  module RailsCompatibility
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
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.3
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-02-09 00:00:00.000000000 Z
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.0.6
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,