leftovers 0.8.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/README.md +7 -7
- data/docs/Configuration.md +169 -38
- data/docs/Custom-Precompilers.md +6 -0
- data/leftovers.gemspec +2 -1
- data/lib/config/actioncable.yml +36 -0
- data/lib/config/actionmailbox.yml +31 -0
- data/lib/config/actionmailer.yml +91 -12
- data/lib/config/actionpack.yml +139 -35
- data/lib/config/actiontext.yml +56 -0
- data/lib/config/actionview.yml +194 -44
- data/lib/config/activejob.yml +16 -10
- data/lib/config/activemodel.yml +195 -27
- data/lib/config/activerecord.yml +436 -88
- data/lib/config/activestorage.yml +26 -0
- data/lib/config/activesupport.yml +177 -24
- data/lib/config/leftovers.yml +48 -0
- data/lib/config/rails.yml +7 -3
- data/lib/config/railties.yml +7 -0
- data/lib/config/ruby.yml +438 -83
- data/lib/config/test-unit.yml +8 -0
- data/lib/leftovers/ast/array_node.rb +12 -0
- data/lib/leftovers/ast/block_node.rb +12 -0
- data/lib/leftovers/ast/builder.rb +24 -5
- data/lib/leftovers/ast/casgn_node.rb +20 -0
- data/lib/leftovers/ast/const_node.rb +15 -0
- data/lib/leftovers/ast/def_node.rb +15 -0
- data/lib/leftovers/ast/defs_node.rb +15 -0
- data/lib/leftovers/ast/false_node.rb +24 -0
- data/lib/leftovers/ast/has_arguments.rb +31 -0
- data/lib/leftovers/ast/hash_node.rb +17 -0
- data/lib/leftovers/ast/module_node.rb +16 -0
- data/lib/leftovers/ast/nil_node.rb +23 -0
- data/lib/leftovers/ast/node.rb +33 -90
- data/lib/leftovers/ast/numeric_node.rb +22 -0
- data/lib/leftovers/ast/send_node.rb +25 -0
- data/lib/leftovers/ast/str_node.rb +24 -0
- data/lib/leftovers/ast/sym_node.rb +25 -0
- data/lib/leftovers/ast/true_node.rb +24 -0
- data/lib/leftovers/ast/var_node.rb +14 -0
- data/lib/leftovers/ast/vasgn_node.rb +20 -0
- data/lib/leftovers/ast.rb +18 -0
- data/lib/leftovers/cli.rb +7 -1
- data/lib/leftovers/comparable_instance.rb +18 -0
- data/lib/leftovers/config_loader/argument_position_schema.rb +3 -1
- data/lib/leftovers/config_loader/array_schema.rb +53 -0
- data/lib/leftovers/config_loader/document_schema.rb +3 -2
- data/lib/leftovers/config_loader/dynamic_schema.rb +1 -0
- data/lib/leftovers/config_loader/has_receiver_schema.rb +15 -0
- data/lib/leftovers/config_loader/has_value_schema.rb +5 -1
- data/lib/leftovers/config_loader/keyword_argument_schema.rb +13 -0
- data/lib/leftovers/config_loader/regexp_schema.rb +27 -0
- data/lib/leftovers/config_loader/rule_pattern_schema.rb +3 -1
- data/lib/leftovers/config_loader/scalar_value_schema.rb +8 -0
- data/lib/leftovers/config_loader/schema.rb +10 -0
- data/lib/leftovers/config_loader/string_enum_schema.rb +1 -1
- data/lib/leftovers/config_loader/string_pattern_schema.rb +1 -1
- data/lib/leftovers/config_loader/transform_schema.rb +12 -6
- data/lib/leftovers/config_loader/value_matcher_condition_schema.rb +13 -0
- data/lib/leftovers/config_loader/value_matcher_schema.rb +4 -1
- data/lib/leftovers/config_loader/value_or_array_schema.rb +2 -34
- data/lib/leftovers/config_loader/value_processor_schema.rb +2 -2
- data/lib/leftovers/config_loader.rb +12 -4
- data/lib/leftovers/definition_collection.rb +37 -0
- data/lib/leftovers/definition_node.rb +8 -14
- data/lib/leftovers/definition_node_set.rb +10 -2
- data/lib/leftovers/file.rb +1 -1
- data/lib/leftovers/file_collector/comments_processor.rb +1 -1
- data/lib/leftovers/file_collector/node_processor.rb +7 -7
- data/lib/leftovers/file_collector.rb +26 -32
- data/lib/leftovers/file_list.rb +3 -2
- data/lib/leftovers/matcher_builders/and.rb +26 -9
- data/lib/leftovers/matcher_builders/node.rb +32 -20
- data/lib/leftovers/matcher_builders/node_has_keyword_argument.rb +3 -1
- data/lib/leftovers/matcher_builders/node_has_receiver.rb +12 -3
- data/lib/leftovers/matcher_builders/node_pair_key.rb +16 -0
- data/lib/leftovers/matcher_builders/node_type.rb +9 -9
- data/lib/leftovers/matcher_builders/node_value.rb +25 -9
- data/lib/leftovers/matcher_builders/or.rb +22 -7
- data/lib/leftovers/matcher_builders/path.rb +3 -1
- data/lib/leftovers/matcher_builders.rb +1 -1
- data/lib/leftovers/matchers/all.rb +4 -0
- data/lib/leftovers/matchers/and.rb +4 -0
- data/lib/leftovers/matchers/any.rb +2 -0
- data/lib/leftovers/matchers/node_has_any_keyword_argument.rb +7 -4
- data/lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb +5 -4
- data/lib/leftovers/matchers/node_has_any_receiver.rb +13 -0
- data/lib/leftovers/matchers/node_has_positional_argument.rb +5 -1
- data/lib/leftovers/matchers/node_has_positional_argument_with_value.rb +6 -1
- data/lib/leftovers/matchers/node_has_receiver.rb +4 -0
- data/lib/leftovers/matchers/node_is_proc.rb +13 -0
- data/lib/leftovers/matchers/node_name.rb +9 -3
- data/lib/leftovers/matchers/node_pair_key.rb +23 -0
- data/lib/leftovers/matchers/node_pair_value.rb +7 -3
- data/lib/leftovers/matchers/node_path.rb +7 -3
- data/lib/leftovers/matchers/node_privacy.rb +7 -3
- data/lib/leftovers/matchers/node_scalar_value.rb +6 -1
- data/lib/leftovers/matchers/node_type.rb +7 -3
- data/lib/leftovers/matchers/not.rb +2 -0
- data/lib/leftovers/matchers/or.rb +2 -0
- data/lib/leftovers/matchers/path.rb +21 -0
- data/lib/leftovers/matchers.rb +4 -1
- data/lib/leftovers/merged_config.rb +26 -25
- data/lib/leftovers/parser.rb +7 -4
- data/lib/leftovers/precompilers.rb +5 -5
- data/lib/leftovers/processor_builders/action.rb +55 -37
- data/lib/leftovers/processor_builders/add_prefix.rb +18 -10
- data/lib/leftovers/processor_builders/add_suffix.rb +18 -10
- data/lib/leftovers/processor_builders/argument.rb +28 -11
- data/lib/leftovers/processor_builders/dynamic.rb +37 -31
- data/lib/leftovers/processor_builders/each.rb +82 -10
- data/lib/leftovers/processor_builders/itself.rb +2 -2
- data/lib/leftovers/processor_builders/keyword.rb +7 -6
- data/lib/leftovers/processor_builders/keyword_argument.rb +4 -2
- data/lib/leftovers/processor_builders/receiver.rb +13 -0
- data/lib/leftovers/processor_builders/transform.rb +55 -44
- data/lib/leftovers/processor_builders/transform_chain.rb +1 -1
- data/lib/leftovers/processor_builders/transform_set.rb +9 -29
- data/lib/leftovers/processor_builders/value.rb +4 -4
- data/lib/leftovers/processor_builders.rb +1 -3
- data/lib/leftovers/processors/add_call.rb +14 -0
- data/lib/leftovers/processors/add_definition_node.rb +16 -0
- data/lib/leftovers/processors/add_dynamic_prefix.rb +29 -0
- data/lib/leftovers/processors/add_dynamic_suffix.rb +29 -0
- data/lib/leftovers/{value_processors → processors}/add_prefix.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/add_suffix.rb +7 -3
- data/lib/leftovers/processors/append_sym.rb +13 -0
- data/lib/leftovers/{value_processors → processors}/camelize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/capitalize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/deconstantize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/delete_after.rb +9 -5
- data/lib/leftovers/processors/delete_after_last.rb +26 -0
- data/lib/leftovers/processors/delete_before.rb +27 -0
- data/lib/leftovers/processors/delete_before_last.rb +27 -0
- data/lib/leftovers/{value_processors → processors}/delete_prefix.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/delete_suffix.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/demodulize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/downcase.rb +7 -3
- data/lib/leftovers/processors/each.rb +25 -0
- data/lib/leftovers/processors/each_for_definition_set.rb +33 -0
- data/lib/leftovers/processors/each_keyword.rb +29 -0
- data/lib/leftovers/processors/each_keyword_argument.rb +29 -0
- data/lib/leftovers/processors/each_positional_argument.rb +27 -0
- data/lib/leftovers/processors/each_positional_argument_from.rb +30 -0
- data/lib/leftovers/processors/eval.rb +16 -0
- data/lib/leftovers/processors/itself.rb +21 -0
- data/lib/leftovers/processors/keyword_argument.rb +30 -0
- data/lib/leftovers/processors/match_current_node.rb +26 -0
- data/lib/leftovers/processors/match_matched_node.rb +26 -0
- data/lib/leftovers/{value_processors → processors}/parameterize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/placeholder.rb +5 -4
- data/lib/leftovers/{value_processors → processors}/pluralize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/positional_argument.rb +8 -6
- data/lib/leftovers/processors/receiver.rb +24 -0
- data/lib/leftovers/{value_processors → processors}/replace_value.rb +7 -3
- data/lib/leftovers/processors/set_default_privacy.rb +21 -0
- data/lib/leftovers/processors/set_privacy.rb +23 -0
- data/lib/leftovers/{value_processors → processors}/singularize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/split.rb +8 -4
- data/lib/leftovers/{value_processors → processors}/swapcase.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/titleize.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/underscore.rb +7 -3
- data/lib/leftovers/{value_processors → processors}/upcase.rb +7 -3
- data/lib/leftovers/processors.rb +49 -0
- data/lib/leftovers/reporter.rb +2 -2
- data/lib/leftovers/version.rb +1 -1
- data/lib/leftovers.rb +3 -12
- metadata +99 -52
- data/lib/leftovers/dynamic_processors/call.rb +0 -22
- data/lib/leftovers/dynamic_processors/call_definition.rb +0 -34
- data/lib/leftovers/dynamic_processors/definition.rb +0 -27
- data/lib/leftovers/dynamic_processors/each.rb +0 -19
- data/lib/leftovers/dynamic_processors/null.rb +0 -9
- data/lib/leftovers/dynamic_processors/set_default_privacy.rb +0 -18
- data/lib/leftovers/dynamic_processors/set_privacy.rb +0 -23
- data/lib/leftovers/dynamic_processors.rb +0 -13
- data/lib/leftovers/matcher_builders/node_pair_name.rb +0 -18
- data/lib/leftovers/matchers/predicate.rb +0 -19
- data/lib/leftovers/processor_builders/each_action.rb +0 -51
- data/lib/leftovers/processor_builders/each_dynamic.rb +0 -50
- data/lib/leftovers/processor_builders/each_for_definition_set.rb +0 -40
- data/lib/leftovers/value_processors/add_dynamic_prefix.rb +0 -24
- data/lib/leftovers/value_processors/add_dynamic_suffix.rb +0 -24
- data/lib/leftovers/value_processors/delete_before.rb +0 -22
- data/lib/leftovers/value_processors/each.rb +0 -21
- data/lib/leftovers/value_processors/each_for_definition_set.rb +0 -23
- data/lib/leftovers/value_processors/each_keyword.rb +0 -27
- data/lib/leftovers/value_processors/each_keyword_argument.rb +0 -27
- data/lib/leftovers/value_processors/each_positional_argument.rb +0 -25
- data/lib/leftovers/value_processors/itself.rb +0 -17
- data/lib/leftovers/value_processors/keyword.rb +0 -28
- data/lib/leftovers/value_processors/keyword_argument.rb +0 -28
- data/lib/leftovers/value_processors/return_definition_node.rb +0 -14
- data/lib/leftovers/value_processors/return_sym.rb +0 -14
- data/lib/leftovers/value_processors.rb +0 -40
data/lib/config/activerecord.yml
CHANGED
@@ -1,43 +1,171 @@
|
|
1
|
-
#
|
2
|
-
# rails is _really complicated_ and has a lot of magic which calls methods for you.
|
3
|
-
# some is currently impossible to handle (with_options).
|
4
|
-
# Some is just corners of rails I haven't hit yet.
|
1
|
+
# https://guides.rubyonrails.org/active_record_basics.html
|
5
2
|
|
6
|
-
|
7
|
-
|
3
|
+
|
4
|
+
gems:
|
5
|
+
- activesupport
|
6
|
+
- activemodel
|
7
|
+
|
8
|
+
keep:
|
9
|
+
# https://guides.rubyonrails.org/active_record_migrations.html#migration-overview
|
10
|
+
- path: db/migrate/*
|
11
|
+
type: Constant
|
12
|
+
- path: db/migrate/*
|
13
|
+
name: [up, down, change]
|
8
14
|
|
9
15
|
dynamic:
|
16
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html
|
10
17
|
- names:
|
11
|
-
-
|
12
|
-
-
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
- after_create
|
19
|
-
- before_update
|
20
|
-
- around_update
|
21
|
-
- after_update
|
22
|
-
- before_destroy
|
23
|
-
- around_destroy
|
24
|
-
- after_destroy
|
25
|
-
- after_commit
|
26
|
-
- after_rollback
|
27
|
-
- after_create_commit
|
28
|
-
- after_update_commit
|
29
|
-
- after_destroy_commit
|
30
|
-
- after_save_commit
|
18
|
+
- validates_associated
|
19
|
+
- validates_absence_of
|
20
|
+
- validates_length_of
|
21
|
+
- validates_size_of
|
22
|
+
- validates_numericality_of
|
23
|
+
- validates_presence_of
|
24
|
+
- validates_uniqueness_of
|
31
25
|
calls:
|
32
|
-
- arguments:
|
26
|
+
- arguments: '*'
|
33
27
|
- arguments: [if, unless]
|
28
|
+
nested: '*'
|
29
|
+
|
30
|
+
- name: validates_uniqueness_of
|
31
|
+
calls:
|
32
|
+
arguments: scope
|
33
|
+
nested: '*'
|
34
|
+
|
35
|
+
- name: [validates, validates!]
|
36
|
+
calls:
|
37
|
+
- arguments: scope
|
38
|
+
- arguments: uniqueness
|
39
|
+
nested:
|
40
|
+
arguments: scope
|
41
|
+
nested: '*'
|
42
|
+
|
43
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Aggregations/ClassMethods.html
|
44
|
+
# i had to read the code for this
|
45
|
+
- name: composed_of
|
46
|
+
calls:
|
47
|
+
- argument: class_name
|
48
|
+
split: '::'
|
49
|
+
- argument: [converter, constructor]
|
50
|
+
defines:
|
51
|
+
argument: 0
|
52
|
+
transforms:
|
53
|
+
- original
|
54
|
+
- add_suffix: '='
|
55
|
+
|
56
|
+
- name: composed_of
|
57
|
+
unless:
|
58
|
+
has_argument: class_name
|
59
|
+
calls:
|
60
|
+
argument: 0
|
61
|
+
camelize: true
|
62
|
+
split: '::'
|
63
|
+
|
64
|
+
- name: composed_of
|
65
|
+
unless:
|
66
|
+
has_argument: constructor
|
67
|
+
calls:
|
68
|
+
value: new
|
69
|
+
|
70
|
+
- name: composed_of
|
71
|
+
has_argument:
|
72
|
+
at: mapping
|
73
|
+
has_value:
|
74
|
+
has_argument:
|
75
|
+
at: 0
|
76
|
+
has_value:
|
77
|
+
type: Array
|
78
|
+
calls:
|
79
|
+
argument: mapping
|
80
|
+
nested:
|
81
|
+
argument: '*'
|
34
82
|
nested:
|
35
|
-
|
83
|
+
argument: 1
|
84
|
+
transforms:
|
85
|
+
- original
|
86
|
+
- add_suffix: '='
|
87
|
+
|
88
|
+
- name: composed_of
|
89
|
+
has_argument:
|
90
|
+
at: mapping
|
91
|
+
has_value:
|
92
|
+
has_argument:
|
93
|
+
at: 0
|
94
|
+
unless:
|
95
|
+
has_value:
|
96
|
+
type: Array
|
97
|
+
calls:
|
98
|
+
argument: mapping
|
99
|
+
nested:
|
100
|
+
argument: 1
|
101
|
+
transforms:
|
102
|
+
- original
|
103
|
+
- add_suffix: '='
|
104
|
+
|
105
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
|
106
|
+
- name: has_one
|
107
|
+
unless:
|
108
|
+
has_receiver: true
|
109
|
+
defines:
|
110
|
+
argument: 0
|
111
|
+
transforms:
|
112
|
+
- original
|
113
|
+
- add_suffix: '='
|
114
|
+
- add_prefix: build_
|
115
|
+
- add_prefix: create_
|
116
|
+
- { add_prefix: create_, add_suffix: '!' }
|
117
|
+
- add_prefix: reload_
|
118
|
+
|
119
|
+
- name: belongs_to
|
120
|
+
has_argument: polymorphic
|
121
|
+
unless:
|
122
|
+
has_receiver: true
|
123
|
+
defines:
|
124
|
+
argument: 0
|
125
|
+
transforms:
|
126
|
+
- original
|
127
|
+
- add_suffix: '='
|
128
|
+
- add_prefix: reload_
|
129
|
+
- add_suffix: _changed?
|
130
|
+
- add_suffix: _previously_changed?
|
131
|
+
|
132
|
+
- name: belongs_to
|
133
|
+
unless:
|
134
|
+
any:
|
135
|
+
- has_argument: polymorphic
|
136
|
+
- has_receiver: true
|
137
|
+
defines:
|
138
|
+
argument: 0
|
139
|
+
transforms:
|
140
|
+
- original
|
141
|
+
- add_suffix: '='
|
142
|
+
- add_prefix: build_
|
143
|
+
- add_prefix: create_
|
144
|
+
- { add_prefix: create_, add_suffix: '!' }
|
145
|
+
- add_prefix: reload_
|
146
|
+
- add_suffix: _changed?
|
147
|
+
- add_suffix: _previously_changed?
|
148
|
+
|
149
|
+
- name: [has_and_belongs_to_many, has_many]
|
150
|
+
unless:
|
151
|
+
has_receiver: true
|
152
|
+
defines:
|
153
|
+
argument: 0
|
154
|
+
transforms:
|
155
|
+
- original
|
156
|
+
- add_suffix: '='
|
157
|
+
- singularize: true
|
158
|
+
add_suffix: _ids
|
159
|
+
- singularize: true
|
160
|
+
add_suffix: _ids=
|
161
|
+
|
36
162
|
- name:
|
37
163
|
- has_one
|
38
164
|
- belongs_to
|
39
165
|
unless:
|
40
|
-
|
166
|
+
any:
|
167
|
+
- has_argument: [class_name, polymorphic]
|
168
|
+
- has_receiver: true
|
41
169
|
calls:
|
42
170
|
argument: 0
|
43
171
|
camelize: true
|
@@ -47,24 +175,15 @@ dynamic:
|
|
47
175
|
- has_many
|
48
176
|
- has_and_belongs_to_many
|
49
177
|
unless:
|
50
|
-
|
178
|
+
any:
|
179
|
+
- has_argument: [class_name, polymorphic]
|
180
|
+
- has_receiver: true
|
51
181
|
calls:
|
52
182
|
- argument: 0
|
53
183
|
camelize: true
|
54
184
|
singularize: true
|
55
185
|
split: '::'
|
56
|
-
|
57
|
-
- has_many
|
58
|
-
- has_and_belongs_to_many
|
59
|
-
defines:
|
60
|
-
- argument: 0
|
61
|
-
transforms:
|
62
|
-
- original
|
63
|
-
- add_suffix: '='
|
64
|
-
- singularize: true
|
65
|
-
add_suffix: _ids
|
66
|
-
- singularize: true
|
67
|
-
add_suffix: _ids=
|
186
|
+
|
68
187
|
- name:
|
69
188
|
- has_many
|
70
189
|
- has_one
|
@@ -80,24 +199,14 @@ dynamic:
|
|
80
199
|
- source_type
|
81
200
|
- source
|
82
201
|
- through
|
83
|
-
|
84
|
-
- has_one
|
85
|
-
- belongs_to
|
86
|
-
defines:
|
87
|
-
- argument: 0
|
88
|
-
transforms:
|
89
|
-
- original
|
90
|
-
- add_suffix: '='
|
91
|
-
- add_prefix: build_
|
92
|
-
- add_prefix: create_
|
93
|
-
- add_prefix: create_
|
94
|
-
add_suffix: '!'
|
95
|
-
- add_prefix: reload
|
202
|
+
|
96
203
|
- name: belongs_to
|
97
204
|
unless:
|
98
|
-
|
99
|
-
|
100
|
-
|
205
|
+
any:
|
206
|
+
- has_argument:
|
207
|
+
at: optional
|
208
|
+
has_value: true
|
209
|
+
- has_receiver: true
|
101
210
|
calls:
|
102
211
|
argument: 0
|
103
212
|
|
@@ -106,39 +215,178 @@ dynamic:
|
|
106
215
|
- has_many
|
107
216
|
- belongs_to
|
108
217
|
- has_and_belongs_to_many
|
218
|
+
unless:
|
219
|
+
has_receiver: true
|
109
220
|
calls:
|
110
221
|
- argument: class_name
|
111
222
|
split: '::'
|
112
223
|
- argument: inverse_of
|
113
224
|
- argument: touch
|
114
225
|
add_suffix: '='
|
226
|
+
|
227
|
+
- name: belongs_to
|
228
|
+
unless:
|
229
|
+
has_receiver: true
|
230
|
+
calls:
|
231
|
+
argument: ensuring_owner_was
|
232
|
+
|
233
|
+
# these arguments cause something to be done to the association regardless of it being called directly
|
115
234
|
- name:
|
116
235
|
- has_one
|
117
236
|
- has_many
|
118
237
|
- belongs_to
|
119
238
|
- has_and_belongs_to_many
|
239
|
+
unless:
|
240
|
+
has_receiver: true
|
120
241
|
has_argument:
|
121
|
-
at:
|
242
|
+
at:
|
243
|
+
- dependent
|
244
|
+
- before_add
|
245
|
+
- after_add
|
246
|
+
- before_remove
|
247
|
+
- after_remove
|
248
|
+
- inverse_of
|
249
|
+
- touch
|
250
|
+
- validate
|
251
|
+
- autosave
|
122
252
|
unless:
|
123
|
-
has_value: false
|
253
|
+
has_value: [false, null]
|
124
254
|
calls:
|
125
255
|
argument: 0
|
126
|
-
- name: scope
|
127
|
-
has_argument:
|
128
|
-
at: 1
|
129
|
-
has_value:
|
130
|
-
type: Proc
|
131
|
-
defines:
|
132
|
-
argument: 0
|
133
256
|
|
257
|
+
- name: [has_one, has_many, belongs_to, has_and_belongs_to_many]
|
258
|
+
unless:
|
259
|
+
has_receiver: true
|
260
|
+
calls:
|
261
|
+
argument: [before_add, after_add, before_remove, after_remove]
|
262
|
+
nested: '*'
|
263
|
+
|
264
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/CollectionProxy.html
|
134
265
|
- name:
|
135
266
|
- create
|
136
267
|
- create!
|
137
268
|
- update
|
138
269
|
- update!
|
270
|
+
- build
|
139
271
|
calls:
|
140
|
-
keyword: '**'
|
272
|
+
- keyword: '**'
|
273
|
+
add_suffix: '='
|
274
|
+
- argument: 0
|
275
|
+
nested:
|
276
|
+
argument: '*'
|
277
|
+
keyword: '**'
|
278
|
+
add_suffix: '='
|
279
|
+
|
280
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Attributes/ClassMethods.html#method-i-attribute
|
281
|
+
- name: attribute
|
282
|
+
defines:
|
283
|
+
argument: 0
|
284
|
+
transforms:
|
285
|
+
- original
|
286
|
+
- add_suffix: '='
|
287
|
+
- add_suffix: '?'
|
288
|
+
- add_suffix: _before_type_cast
|
289
|
+
- add_suffix: _before_last_save
|
290
|
+
- add_suffix: _change_to_be_saved
|
291
|
+
- add_suffix: _in_database
|
292
|
+
- add_prefix: saved_change_to_
|
293
|
+
- { add_prefix: saved_change_to_, add_suffix: '?' }
|
294
|
+
- { add_prefix: will_save_change_to_, add_suffix: '?' }
|
295
|
+
- add_prefix: find_by_
|
296
|
+
|
297
|
+
- name: { match: 'find_by_\w+_and_\w+' }
|
298
|
+
calls:
|
299
|
+
itself: true
|
300
|
+
delete_prefix: find_by_
|
301
|
+
split: '_and_'
|
302
|
+
|
303
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods.html#method-i-5B-5D
|
304
|
+
- name: '[]'
|
305
|
+
calls: 0
|
306
|
+
|
307
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods.html#method-i-5B-5D=
|
308
|
+
- name: '[]='
|
309
|
+
calls:
|
310
|
+
argument: 0
|
141
311
|
add_suffix: '='
|
312
|
+
|
313
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods.html#method-i-attribute_for_inspect
|
314
|
+
- name: attribute_for_inspect
|
315
|
+
calls: 0
|
316
|
+
|
317
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods.html#method-i-attribute_present?
|
318
|
+
- name: attribute_present?
|
319
|
+
calls: 0
|
320
|
+
|
321
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/BeforeTypeCast.html#method-i-read_attribute_before_type_cast
|
322
|
+
- name: read_attribute_before_type_cast
|
323
|
+
calls: 0
|
324
|
+
|
325
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Dirty.html#method-i-attribute_before_last_save
|
326
|
+
- name: attribute_before_last_save
|
327
|
+
calls: 0
|
328
|
+
|
329
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Dirty.html#method-i-attribute_change_to_be_save
|
330
|
+
- name: attribute_change_to_be_saved
|
331
|
+
calls: 0
|
332
|
+
|
333
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Dirty.html#method-i-saved_change_to_attribute
|
334
|
+
- name: saved_change_to_attribute
|
335
|
+
calls: 0
|
336
|
+
|
337
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Dirty.html#method-i-saved_change_to_attribute-3F
|
338
|
+
- name: saved_change_to_attribute?
|
339
|
+
calls: 0
|
340
|
+
|
341
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Dirty.html#method-i-saved_change_to_attribute-3F
|
342
|
+
- name: will_save_change_to_attribute?
|
343
|
+
calls: 0
|
344
|
+
|
345
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Read.html#method-i-read_attribute
|
346
|
+
- name: read_attribute
|
347
|
+
calls: 0
|
348
|
+
|
349
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize
|
350
|
+
- name: serialize
|
351
|
+
calls: 0
|
352
|
+
|
353
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Write.html
|
354
|
+
- name: write_attribute
|
355
|
+
calls: 0
|
356
|
+
|
357
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/DelegatedType.html#method-i-delegated_type
|
358
|
+
- name: delegated_type
|
359
|
+
calls:
|
360
|
+
argument: types
|
361
|
+
nested: '*'
|
362
|
+
split: '::'
|
363
|
+
|
364
|
+
- names:
|
365
|
+
- after_commit
|
366
|
+
- after_create
|
367
|
+
- after_create_commit
|
368
|
+
- after_destroy
|
369
|
+
- after_destroy_commit
|
370
|
+
- after_find
|
371
|
+
- after_rollback
|
372
|
+
- after_save
|
373
|
+
- after_save_commit
|
374
|
+
- after_touch
|
375
|
+
- after_update
|
376
|
+
- after_update_commit
|
377
|
+
- around_create
|
378
|
+
- around_destroy
|
379
|
+
- around_save
|
380
|
+
- around_update
|
381
|
+
- before_create
|
382
|
+
- before_destroy
|
383
|
+
- before_save
|
384
|
+
- before_update
|
385
|
+
calls:
|
386
|
+
- arguments: '*'
|
387
|
+
- arguments: [if, unless]
|
388
|
+
nested: '*'
|
389
|
+
|
142
390
|
- name:
|
143
391
|
- includes
|
144
392
|
- preload
|
@@ -149,26 +397,9 @@ dynamic:
|
|
149
397
|
calls:
|
150
398
|
arguments: ['*', '**']
|
151
399
|
keywords: '**'
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
- integer
|
156
|
-
- bigint
|
157
|
-
- float
|
158
|
-
- decimal
|
159
|
-
- numeric
|
160
|
-
- datetime
|
161
|
-
- time
|
162
|
-
- date
|
163
|
-
- binary
|
164
|
-
- boolean
|
165
|
-
path: /db/schema.rb
|
166
|
-
calls:
|
167
|
-
argument: 0
|
168
|
-
transforms:
|
169
|
-
- original
|
170
|
-
- add_suffix: '='
|
171
|
-
- add_suffix: '?'
|
400
|
+
recursive: true
|
401
|
+
|
402
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
|
172
403
|
- name: accepts_nested_attributes_for
|
173
404
|
defines:
|
174
405
|
argument: '*'
|
@@ -177,3 +408,120 @@ dynamic:
|
|
177
408
|
- add_suffix: _attributes=
|
178
409
|
calls:
|
179
410
|
argument: reject_if
|
411
|
+
|
412
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute
|
413
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute-21
|
414
|
+
- name: [update_attribute, update_attribute!]
|
415
|
+
calls:
|
416
|
+
argument: 0
|
417
|
+
add_suffix: '='
|
418
|
+
|
419
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/QueryMethods.html#method-i-create_with
|
420
|
+
- name: create_with
|
421
|
+
calls:
|
422
|
+
keyword: '**'
|
423
|
+
add_suffix: '='
|
424
|
+
|
425
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_aggregation
|
426
|
+
- name: reflect_on_aggregation
|
427
|
+
calls: 0
|
428
|
+
|
429
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Reflection/ClassMethods.html#method-i-reflect_on_association
|
430
|
+
- name: reflect_on_association
|
431
|
+
calls: 0
|
432
|
+
|
433
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-create_or_find_by
|
434
|
+
- name: [create_or_find_by, create_or_find_by!, find_or_create_by, find_or_create_by!, find_or_initialize_by]
|
435
|
+
calls:
|
436
|
+
keyword: '**'
|
437
|
+
|
438
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-scope
|
439
|
+
- name: scope
|
440
|
+
has_argument:
|
441
|
+
at: 1
|
442
|
+
has_value:
|
443
|
+
type: Proc
|
444
|
+
defines:
|
445
|
+
argument: 0
|
446
|
+
|
447
|
+
# https://edgeapi.rubyonrails.org/classes/ActiveRecord/Store.html
|
448
|
+
- name: store
|
449
|
+
defines:
|
450
|
+
argument: accessors
|
451
|
+
nested: '*'
|
452
|
+
add_prefix:
|
453
|
+
- value: ''
|
454
|
+
unless:
|
455
|
+
has_argument: prefix
|
456
|
+
- has_argument:
|
457
|
+
at: prefix
|
458
|
+
has_value: true
|
459
|
+
argument: 0
|
460
|
+
add_suffix: _
|
461
|
+
- has_argument:
|
462
|
+
at: prefix
|
463
|
+
has_value:
|
464
|
+
type: [String, Symbol]
|
465
|
+
argument: prefix
|
466
|
+
add_suffix: _
|
467
|
+
add_suffix:
|
468
|
+
- value: ''
|
469
|
+
unless:
|
470
|
+
has_argument: suffix
|
471
|
+
- has_argument:
|
472
|
+
at: suffix
|
473
|
+
has_value: true
|
474
|
+
argument: 0
|
475
|
+
add_prefix: _
|
476
|
+
- has_argument:
|
477
|
+
at: suffix
|
478
|
+
has_value:
|
479
|
+
type: [String, Symbol]
|
480
|
+
argument: suffix
|
481
|
+
add_prefix: _
|
482
|
+
transforms:
|
483
|
+
- original
|
484
|
+
- add_suffix: '='
|
485
|
+
- add_suffix: _changed?
|
486
|
+
- add_suffix: _was
|
487
|
+
- add_suffix: _change
|
488
|
+
|
489
|
+
- name: store_accessor
|
490
|
+
defines:
|
491
|
+
arguments: 1+
|
492
|
+
add_prefix:
|
493
|
+
- value: ''
|
494
|
+
unless:
|
495
|
+
has_argument: prefix
|
496
|
+
- has_argument:
|
497
|
+
at: prefix
|
498
|
+
has_value: true
|
499
|
+
argument: 0
|
500
|
+
add_suffix: _
|
501
|
+
- has_argument:
|
502
|
+
at: prefix
|
503
|
+
has_value:
|
504
|
+
type: [String, Symbol]
|
505
|
+
argument: prefix
|
506
|
+
add_suffix: _
|
507
|
+
add_suffix:
|
508
|
+
- value: ''
|
509
|
+
unless:
|
510
|
+
has_argument: suffix
|
511
|
+
- has_argument:
|
512
|
+
at: suffix
|
513
|
+
has_value: true
|
514
|
+
argument: 0
|
515
|
+
add_prefix: _
|
516
|
+
- has_argument:
|
517
|
+
at: suffix
|
518
|
+
has_value:
|
519
|
+
type: [String, Symbol]
|
520
|
+
argument: suffix
|
521
|
+
add_prefix: _
|
522
|
+
transforms:
|
523
|
+
- original
|
524
|
+
- add_suffix: '='
|
525
|
+
- add_suffix: _changed?
|
526
|
+
- add_suffix: _was
|
527
|
+
- add_suffix: _change
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# https://guides.rubyonrails.org/active_storage_overview.html
|
2
|
+
gems:
|
3
|
+
- activesupport
|
4
|
+
- actionpack
|
5
|
+
- activejob
|
6
|
+
- activerecord
|
7
|
+
|
8
|
+
dynamic:
|
9
|
+
- name: has_one_attached
|
10
|
+
defines:
|
11
|
+
argument: 0
|
12
|
+
transforms:
|
13
|
+
- original
|
14
|
+
- add_prefix: with_attached_
|
15
|
+
- add_suffix: _attachment
|
16
|
+
- add_suffix: _blob
|
17
|
+
|
18
|
+
- name: has_many_attached
|
19
|
+
defines:
|
20
|
+
argument: 0
|
21
|
+
transforms:
|
22
|
+
- original
|
23
|
+
- add_prefix: with_attached
|
24
|
+
- add_suffix: _attachments
|
25
|
+
- add_suffix: _blobs
|
26
|
+
|