activerecord-belongs_to_if 0.1.1 → 0.2.0
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 +5 -5
- data/.github/release.yml +23 -0
- data/.github/workflows/actions.lock +37 -0
- data/.github/workflows/bump-request.yml +26 -0
- data/.github/workflows/release.yml +11 -0
- data/.github/workflows/test.yml +25 -0
- data/Gemfile +3 -1
- data/README.md +3 -3
- data/activerecord-belongs_to_if.gemspec +1 -2
- data/lib/active_record/belongs_to_if/version.rb +1 -1
- metadata +9 -38
- data/CHANGELOG.md +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2ea614fc97f255ae046946411a4a1a4f1325d4041fcfd3ddd8a8b9d185be773d
|
|
4
|
+
data.tar.gz: a6ff25f45119068212f6f541e5bc868b5cc556b46ff04ed7682eae9913360f00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1fb8c0b97e061b6797bc6c43f756888b1a87bbbf53b4a1ce4b25f00b0dab91cdf4d169a0789c564a17198fdcd32590cc18a1e779a2fe010fe4895a0f7d58d1d
|
|
7
|
+
data.tar.gz: bef5f3a24ae26e46dc3e01227297984e06496374571cfe7c8a64986a39553bb8afe05cdcaf91a9fbda9ec31eacee11827084e1ce3d98be1076aaae52a4832644
|
data/.github/release.yml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
changelog:
|
|
2
|
+
categories:
|
|
3
|
+
- title: Added
|
|
4
|
+
labels:
|
|
5
|
+
- add
|
|
6
|
+
- title: Changed
|
|
7
|
+
labels:
|
|
8
|
+
- change
|
|
9
|
+
- title: Deprecated
|
|
10
|
+
labels:
|
|
11
|
+
- deprecated
|
|
12
|
+
- title: Fixed
|
|
13
|
+
labels:
|
|
14
|
+
- fix
|
|
15
|
+
- title: Removed
|
|
16
|
+
labels:
|
|
17
|
+
- remove
|
|
18
|
+
- title: Security
|
|
19
|
+
labels:
|
|
20
|
+
- security
|
|
21
|
+
- title: Others
|
|
22
|
+
labels:
|
|
23
|
+
- "*"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This file is machine-generated by `gh actions-lock`.
|
|
2
|
+
# Do not edit by hand; run `gh actions-lock` to update.
|
|
3
|
+
# Docs: https://gh.io/actions-lockfile
|
|
4
|
+
version: 'v0.0.3'
|
|
5
|
+
workflows:
|
|
6
|
+
'.github/workflows/bump-request.yml':
|
|
7
|
+
- 'actions/checkout@v7.0.1'
|
|
8
|
+
- 'r7kamura/bump-request@v0.7.1'
|
|
9
|
+
- 'ruby/setup-ruby@v1.336.0'
|
|
10
|
+
'.github/workflows/release.yml': []
|
|
11
|
+
'.github/workflows/test.yml':
|
|
12
|
+
- 'actions/checkout@v7.0.1'
|
|
13
|
+
- 'ruby/setup-ruby@v1.336.0'
|
|
14
|
+
dependencies:
|
|
15
|
+
'actions/checkout@v7.0.1':
|
|
16
|
+
ref: 'v7.0.1'
|
|
17
|
+
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
|
|
18
|
+
owner_id: 44036562
|
|
19
|
+
repo_id: 197814629
|
|
20
|
+
'actions/setup-node@v7.1.0':
|
|
21
|
+
ref: 'v7.1.0'
|
|
22
|
+
commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1'
|
|
23
|
+
owner_id: 44036562
|
|
24
|
+
repo_id: 189476904
|
|
25
|
+
'r7kamura/bump-request@v0.7.1':
|
|
26
|
+
ref: 'v0.7.1'
|
|
27
|
+
commit: 'sha1-b27937188d404bc0c2fd442403e6de1d20f9b349'
|
|
28
|
+
owner_id: 111689
|
|
29
|
+
repo_id: 533135195
|
|
30
|
+
uses:
|
|
31
|
+
- 'actions/checkout@v7.0.1'
|
|
32
|
+
- 'actions/setup-node@v7.1.0'
|
|
33
|
+
'ruby/setup-ruby@v1.336.0':
|
|
34
|
+
ref: 'v1.336.0'
|
|
35
|
+
commit: 'sha1-de492cf36cbab201753d720ce4f4e336cd688c94'
|
|
36
|
+
owner_id: 210414
|
|
37
|
+
repo_id: 231208785
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: bump-request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: Version to change to.
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
run:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v7.0.1
|
|
16
|
+
- name: Set up Ruby
|
|
17
|
+
uses: ruby/setup-ruby@v1.336.0
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: 3.3
|
|
20
|
+
bundler-cache: true
|
|
21
|
+
- uses: r7kamura/bump-request@v0.7.1
|
|
22
|
+
with:
|
|
23
|
+
command: |
|
|
24
|
+
sed -i -r 's/([0-9]+\.[0-9]+\.[0-9]+)/${{ inputs.version }}/' lib/active_record/belongs_to_if/version.rb
|
|
25
|
+
bundle install
|
|
26
|
+
version: ${{ inputs.version }}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
ruby:
|
|
15
|
+
- '3.3'
|
|
16
|
+
- '3.4'
|
|
17
|
+
- '4.0'
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v7.0.1
|
|
20
|
+
- uses: ruby/setup-ruby@v1.336.0
|
|
21
|
+
with:
|
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
|
23
|
+
bundler-cache: true
|
|
24
|
+
- run: bundle exec ruby -Ilib -e 'require "activerecord-belongs_to_if"; ActiveRecord::Base'
|
|
25
|
+
- run: bundle exec rake build
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -8,9 +8,9 @@ class User < ActiveRecord::Base
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
class Activity < ActiveRecord::Base
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
belongs_to :comment, if: -> { activity_type == "Comment" }
|
|
12
|
+
belongs_to :issue, if: -> { activity_type == "Issue" }
|
|
13
|
+
belongs_to :pull_request, if: -> { activity_type == "PullRequest" }
|
|
14
14
|
end
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -10,6 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.summary = "Allows you to manage preload condition by `:if` condition."
|
|
11
11
|
spec.homepage = "https://github.com/r7kamura/activerecord-belongs_to_if"
|
|
12
12
|
spec.license = "MIT"
|
|
13
|
+
spec.required_ruby_version = ">= 3.3"
|
|
13
14
|
|
|
14
15
|
spec.files = `git ls-files -z`.split("\x0")
|
|
15
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
@@ -18,6 +19,4 @@ Gem::Specification.new do |spec|
|
|
|
18
19
|
|
|
19
20
|
spec.add_dependency "activerecord", ">= 4.0.0"
|
|
20
21
|
spec.add_dependency "activesupport"
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.7"
|
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
|
23
22
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-belongs_to_if
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryo Nakamura
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activerecord
|
|
@@ -38,43 +37,18 @@ dependencies:
|
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: bundler
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1.7'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1.7'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: rake
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '10.0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '10.0'
|
|
69
|
-
description:
|
|
70
40
|
email:
|
|
71
41
|
- r7kamura@gmail.com
|
|
72
42
|
executables: []
|
|
73
43
|
extensions: []
|
|
74
44
|
extra_rdoc_files: []
|
|
75
45
|
files:
|
|
46
|
+
- ".github/release.yml"
|
|
47
|
+
- ".github/workflows/actions.lock"
|
|
48
|
+
- ".github/workflows/bump-request.yml"
|
|
49
|
+
- ".github/workflows/release.yml"
|
|
50
|
+
- ".github/workflows/test.yml"
|
|
76
51
|
- ".gitignore"
|
|
77
|
-
- CHANGELOG.md
|
|
78
52
|
- Gemfile
|
|
79
53
|
- LICENSE.txt
|
|
80
54
|
- README.md
|
|
@@ -89,7 +63,6 @@ homepage: https://github.com/r7kamura/activerecord-belongs_to_if
|
|
|
89
63
|
licenses:
|
|
90
64
|
- MIT
|
|
91
65
|
metadata: {}
|
|
92
|
-
post_install_message:
|
|
93
66
|
rdoc_options: []
|
|
94
67
|
require_paths:
|
|
95
68
|
- lib
|
|
@@ -97,16 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
97
70
|
requirements:
|
|
98
71
|
- - ">="
|
|
99
72
|
- !ruby/object:Gem::Version
|
|
100
|
-
version: '
|
|
73
|
+
version: '3.3'
|
|
101
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
75
|
requirements:
|
|
103
76
|
- - ">="
|
|
104
77
|
- !ruby/object:Gem::Version
|
|
105
78
|
version: '0'
|
|
106
79
|
requirements: []
|
|
107
|
-
|
|
108
|
-
rubygems_version: 2.6.11
|
|
109
|
-
signing_key:
|
|
80
|
+
rubygems_version: 4.0.20
|
|
110
81
|
specification_version: 4
|
|
111
82
|
summary: Allows you to manage preload condition by `:if` condition.
|
|
112
83
|
test_files: []
|
data/CHANGELOG.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
## 0.1.1
|
|
2
|
-
|
|
3
|
-
- Support ActiveRecord 5.2.0
|
|
4
|
-
|
|
5
|
-
## 0.1.0
|
|
6
|
-
|
|
7
|
-
- Support ActiveRecord 5.0.0
|
|
8
|
-
|
|
9
|
-
## 0.0.4
|
|
10
|
-
- Support ActiveRecord 4.2.0
|
|
11
|
-
|
|
12
|
-
## 0.0.3
|
|
13
|
-
- Make it compatible with Ruby 2.0.0
|
|
14
|
-
|
|
15
|
-
## 0.0.2
|
|
16
|
-
- Accepts zero-arity block as :if option
|
|
17
|
-
|
|
18
|
-
## 0.0.1
|
|
19
|
-
- 1st release
|