adaptive_alias 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ruby.yml +70 -0
- data/.gitignore +62 -0
- data/.rubocop.yml +1227 -0
- data/CHANGELOG.md +1 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/LICENSE +21 -0
- data/README.md +46 -0
- data/Rakefile +10 -0
- data/adaptive_alias.gemspec +45 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/gemfiles/6.0.gemfile +10 -0
- data/gemfiles/6.1.gemfile +10 -0
- data/gemfiles/7.0.gemfile +11 -0
- data/lib/adaptive_alias/active_model_patches/read_attribute.rb +20 -0
- data/lib/adaptive_alias/active_model_patches/remove_alias_attribute.rb +27 -0
- data/lib/adaptive_alias/hooks/association.rb +13 -0
- data/lib/adaptive_alias/hooks/association_scope.rb +13 -0
- data/lib/adaptive_alias/hooks/relation.rb +21 -0
- data/lib/adaptive_alias/hooks/singular_association.rb +13 -0
- data/lib/adaptive_alias/patches/back_patch.rb +21 -0
- data/lib/adaptive_alias/patches/base.rb +75 -0
- data/lib/adaptive_alias/patches/forward_patch.rb +21 -0
- data/lib/adaptive_alias/version.rb +3 -0
- data/lib/adaptive_alias.rb +65 -0
- metadata +178 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6f96c867d9849406b6dc38c2d535e6ecf1e62d4de7793d79e78e474588467fc6
|
4
|
+
data.tar.gz: f1b3ff5b3be19513a263212e98c80423f40955af50f744d7f4958202dfaf8659
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3f8f92726071ac5e064dadc6c9aeb96dc72ed3d99c98fe982988405ce1336cf7978a9720dff958e9555464f9edd791370056ce4dec6190d707f06d77c349c686
|
7
|
+
data.tar.gz: 4d70ffe7088a940742a5c0cd12b0ee6f0249abe6c9cd75c162f0e277cf1066ca086ad8e28d4a6253c2cb103bc9e512e068be498d11305ea1b0563818a8100f30
|
@@ -0,0 +1,70 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
paths-ignore:
|
6
|
+
- 'README.md'
|
7
|
+
- 'CHANGELOG.md'
|
8
|
+
pull_request:
|
9
|
+
branches: [ master ]
|
10
|
+
paths-ignore:
|
11
|
+
- 'README.md'
|
12
|
+
- 'CHANGELOG.md'
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
test:
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
name: Test
|
18
|
+
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
|
19
|
+
strategy:
|
20
|
+
fail-fast: false
|
21
|
+
matrix:
|
22
|
+
db:
|
23
|
+
- mysql
|
24
|
+
ruby:
|
25
|
+
- 2.6
|
26
|
+
- 2.7
|
27
|
+
- 3.0
|
28
|
+
- 3.1
|
29
|
+
gemfile:
|
30
|
+
- 6.0.gemfile
|
31
|
+
- 6.1.gemfile
|
32
|
+
- 7.0.gemfile
|
33
|
+
exclude:
|
34
|
+
- gemfile: 7.0.gemfile
|
35
|
+
ruby: 2.6
|
36
|
+
env:
|
37
|
+
BUNDLE_GEMFILE: "gemfiles/${{ matrix.gemfile }}"
|
38
|
+
|
39
|
+
services:
|
40
|
+
mysql:
|
41
|
+
image: mysql:5.6
|
42
|
+
env:
|
43
|
+
MYSQL_ROOT_PASSWORD: root_password
|
44
|
+
MYSQL_USER: developer
|
45
|
+
MYSQL_PASSWORD: developer_password
|
46
|
+
MYSQL_DATABASE: github_actions_test
|
47
|
+
ports:
|
48
|
+
- 3306:3306
|
49
|
+
# Set health checks to wait until mysql has started
|
50
|
+
options: >-
|
51
|
+
--health-cmd "mysqladmin ping"
|
52
|
+
--health-interval 10s
|
53
|
+
--health-timeout 5s
|
54
|
+
--health-retries 3
|
55
|
+
|
56
|
+
steps:
|
57
|
+
- name: Checkout
|
58
|
+
uses: actions/checkout@v2
|
59
|
+
- name: Setup Ruby
|
60
|
+
uses: ruby/setup-ruby@v1
|
61
|
+
with:
|
62
|
+
ruby-version: ${{ matrix.ruby }}
|
63
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
64
|
+
- name: Run tests
|
65
|
+
run: bundle exec rake
|
66
|
+
- name: Publish code coverage
|
67
|
+
if: ${{ success() }}
|
68
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
69
|
+
env:
|
70
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
data/.gitignore
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/.bundle/
|
5
|
+
/.yardoc
|
6
|
+
/_yardoc/
|
7
|
+
/coverage/
|
8
|
+
/InstalledFiles
|
9
|
+
/doc/
|
10
|
+
/pkg/
|
11
|
+
/spec/reports/
|
12
|
+
/spec/examples.txt
|
13
|
+
/test/tmp/
|
14
|
+
/test/version_tmp/
|
15
|
+
/tmp/
|
16
|
+
.idea/
|
17
|
+
|
18
|
+
# Used by dotenv library to load environment variables.
|
19
|
+
# .env
|
20
|
+
|
21
|
+
# Ignore Byebug command history file.
|
22
|
+
.byebug_history
|
23
|
+
|
24
|
+
## Specific to RubyMotion:
|
25
|
+
.dat*
|
26
|
+
.repl_history
|
27
|
+
build/
|
28
|
+
*.bridgesupport
|
29
|
+
build-iPhoneOS/
|
30
|
+
build-iPhoneSimulator/
|
31
|
+
|
32
|
+
## Specific to RubyMotion (use of CocoaPods):
|
33
|
+
#
|
34
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
35
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
36
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
37
|
+
#
|
38
|
+
# vendor/Pods/
|
39
|
+
|
40
|
+
## Documentation cache and generated files:
|
41
|
+
/.yardoc/
|
42
|
+
/_yardoc/
|
43
|
+
/doc/
|
44
|
+
/rdoc/
|
45
|
+
|
46
|
+
## Environment normalization:
|
47
|
+
/.bundle/
|
48
|
+
/vendor/bundle
|
49
|
+
/lib/bundler/man/
|
50
|
+
|
51
|
+
# for a library or gem, you might want to ignore these files since the code is
|
52
|
+
# intended to run in multiple environments; otherwise, check them in:
|
53
|
+
Gemfile.lock
|
54
|
+
/gemfiles/*.gemfile.lock
|
55
|
+
.ruby-version
|
56
|
+
.ruby-gemset
|
57
|
+
|
58
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
59
|
+
.rvmrc
|
60
|
+
|
61
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
62
|
+
# .rubocop-https?--*
|