ruby-lint 0.0.3 → 0.0.4
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.
- data.tar.gz.asc +14 -14
- data/.gitignore +1 -2
- data/.rubocop.yml +59 -0
- data/.travis.yml +3 -7
- data/.yardopts +2 -2
- data/Gemfile +4 -0
- data/MANIFEST +103 -67
- data/README.md +13 -31
- data/Rakefile +1 -6
- data/checksum/ruby-lint-0.0.3.gem.sha512 +1 -0
- data/debug/memory_usage.rb +14 -0
- data/debug/profile.rb +18 -0
- data/doc/architecture.md +14 -18
- data/doc/changelog.md +29 -0
- data/doc/code_analysis.md +12 -12
- data/doc/configuration.md +21 -50
- data/doc/graphviz/flow.dot +1 -1
- data/doc/images/flow.png +0 -0
- data/lib/ruby-lint.rb +33 -19
- data/lib/ruby-lint/analysis/argument_amount.rb +84 -0
- data/lib/ruby-lint/analysis/base.rb +132 -0
- data/lib/ruby-lint/analysis/confusing_variables.rb +26 -0
- data/lib/ruby-lint/analysis/pedantics.rb +36 -0
- data/lib/ruby-lint/analysis/shadowing_variables.rb +47 -0
- data/lib/ruby-lint/analysis/undefined_methods.rb +91 -0
- data/lib/ruby-lint/analysis/undefined_variables.rb +46 -0
- data/lib/ruby-lint/analysis/unused_variables.rb +49 -0
- data/lib/ruby-lint/ast/builder.rb +17 -0
- data/lib/ruby-lint/ast/node.rb +39 -0
- data/lib/ruby-lint/cli.rb +0 -19
- data/lib/ruby-lint/cli/analyze.rb +54 -28
- data/lib/ruby-lint/cli/ast.rb +21 -6
- data/lib/ruby-lint/cli/base.rb +0 -23
- data/lib/ruby-lint/configuration.rb +112 -42
- data/lib/ruby-lint/constant_loader.rb +10 -28
- data/lib/ruby-lint/default_names.rb +19 -0
- data/lib/ruby-lint/definition/constant_proxy.rb +56 -0
- data/lib/ruby-lint/definition/ruby_method.rb +21 -143
- data/lib/ruby-lint/definition/ruby_object.rb +142 -246
- data/lib/ruby-lint/definition_builder/base.rb +43 -0
- data/lib/ruby-lint/definition_builder/primitive.rb +39 -0
- data/lib/ruby-lint/definition_builder/ruby_array.rb +77 -0
- data/lib/ruby-lint/definition_builder/ruby_block.rb +34 -0
- data/lib/ruby-lint/definition_builder/ruby_class.rb +24 -0
- data/lib/ruby-lint/definition_builder/ruby_hash.rb +37 -0
- data/lib/ruby-lint/definition_builder/ruby_method.rb +84 -0
- data/lib/ruby-lint/definition_builder/ruby_module.rb +68 -0
- data/lib/ruby-lint/definition_generator.rb +41 -15
- data/lib/ruby-lint/definitions/core/arg0.rb +1 -1
- data/lib/ruby-lint/definitions/core/argf.rb +1 -1
- data/lib/ruby-lint/definitions/core/argument_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/argv.rb +1 -1
- data/lib/ruby-lint/definitions/core/array.rb +6 -6
- data/lib/ruby-lint/definitions/core/autoload.rb +2 -2
- data/lib/ruby-lint/definitions/core/basic_object.rb +3 -3
- data/lib/ruby-lint/definitions/core/bignum.rb +2 -2
- data/lib/ruby-lint/definitions/core/binding.rb +2 -2
- data/lib/ruby-lint/definitions/core/class.rb +2 -2
- data/lib/ruby-lint/definitions/core/comparable.rb +1 -1
- data/lib/ruby-lint/definitions/core/complex.rb +4 -4
- data/lib/ruby-lint/definitions/core/condition_variable.rb +2 -2
- data/lib/ruby-lint/definitions/core/continuation.rb +2 -2
- data/lib/ruby-lint/definitions/core/data.rb +2 -2
- data/lib/ruby-lint/definitions/core/date.rb +34 -34
- data/lib/ruby-lint/definitions/core/date_time.rb +26 -26
- data/lib/ruby-lint/definitions/core/default_record_separator.rb +1 -1
- data/lib/ruby-lint/definitions/core/digest.rb +14 -14
- data/lib/ruby-lint/definitions/core/dir.rb +34 -34
- data/lib/ruby-lint/definitions/core/encoding.rb +237 -237
- data/lib/ruby-lint/definitions/core/encoding_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/enumerable.rb +15 -15
- data/lib/ruby-lint/definitions/core/enumerator.rb +2 -2
- data/lib/ruby-lint/definitions/core/env.rb +1 -1
- data/lib/ruby-lint/definitions/core/eoferror.rb +2 -2
- data/lib/ruby-lint/definitions/core/erb.rb +22 -22
- data/lib/ruby-lint/definitions/core/errno.rb +525 -525
- data/lib/ruby-lint/definitions/core/etc.rb +6 -6
- data/lib/ruby-lint/definitions/core/exception.rb +2 -2
- data/lib/ruby-lint/definitions/core/false.rb +1 -1
- data/lib/ruby-lint/definitions/core/false_class.rb +2 -2
- data/lib/ruby-lint/definitions/core/fatal_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/fiber.rb +2 -2
- data/lib/ruby-lint/definitions/core/fiber_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/file.rb +68 -68
- data/lib/ruby-lint/definitions/core/file_list.rb +2 -2
- data/lib/ruby-lint/definitions/core/file_test.rb +1 -1
- data/lib/ruby-lint/definitions/core/file_utils.rb +16 -16
- data/lib/ruby-lint/definitions/core/fixnum.rb +4 -4
- data/lib/ruby-lint/definitions/core/float.rb +16 -16
- data/lib/ruby-lint/definitions/core/float_domain_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/gc.rb +2 -2
- data/lib/ruby-lint/definitions/core/gem.rb +119 -119
- data/lib/ruby-lint/definitions/core/hash.rb +14 -14
- data/lib/ruby-lint/definitions/core/immediate_value.rb +1 -1
- data/lib/ruby-lint/definitions/core/index_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/integer.rb +2 -2
- data/lib/ruby-lint/definitions/core/interrupt.rb +2 -2
- data/lib/ruby-lint/definitions/core/io.rb +38 -38
- data/lib/ruby-lint/definitions/core/ioerror.rb +2 -2
- data/lib/ruby-lint/definitions/core/kernel.rb +3 -3
- data/lib/ruby-lint/definitions/core/key_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/load_error.rb +6 -6
- data/lib/ruby-lint/definitions/core/local_jump_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/main.rb +1 -1
- data/lib/ruby-lint/definitions/core/marshal.rb +35 -35
- data/lib/ruby-lint/definitions/core/match_data.rb +2 -2
- data/lib/ruby-lint/definitions/core/math.rb +7 -7
- data/lib/ruby-lint/definitions/core/memory_segmention_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/method.rb +2 -2
- data/lib/ruby-lint/definitions/core/module.rb +1 -1
- data/lib/ruby-lint/definitions/core/monitor.rb +4 -4
- data/lib/ruby-lint/definitions/core/monitor_mixin.rb +5 -5
- data/lib/ruby-lint/definitions/core/mutex.rb +2 -2
- data/lib/ruby-lint/definitions/core/name_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/nil.rb +1 -1
- data/lib/ruby-lint/definitions/core/nil_class.rb +2 -2
- data/lib/ruby-lint/definitions/core/no_memory_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/no_method_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/not_implemented_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/numeric.rb +2 -2
- data/lib/ruby-lint/definitions/core/object.rb +2 -2
- data/lib/ruby-lint/definitions/core/object_space.rb +1 -1
- data/lib/ruby-lint/definitions/core/open_struct.rb +3 -3
- data/lib/ruby-lint/definitions/core/option_parser.rb +83 -83
- data/lib/ruby-lint/definitions/core/precision.rb +1 -1
- data/lib/ruby-lint/definitions/core/primitive_failure.rb +2 -2
- data/lib/ruby-lint/definitions/core/proc.rb +2 -2
- data/lib/ruby-lint/definitions/core/process.rb +29 -29
- data/lib/ruby-lint/definitions/core/psych.rb +149 -149
- data/lib/ruby-lint/definitions/core/queue.rb +2 -2
- data/lib/ruby-lint/definitions/core/rake.rb +117 -117
- data/lib/ruby-lint/definitions/core/rake_file_utils.rb +1 -1
- data/lib/ruby-lint/definitions/core/rakeversion.rb +1 -1
- data/lib/ruby-lint/definitions/core/random.rb +2 -2
- data/lib/ruby-lint/definitions/core/range.rb +4 -4
- data/lib/ruby-lint/definitions/core/range_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/rational.rb +2 -2
- data/lib/ruby-lint/definitions/core/rb_config.rb +3 -3
- data/lib/ruby-lint/definitions/core/regexp.rb +28 -28
- data/lib/ruby-lint/definitions/core/regexp_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/rubinius.rb +1057 -1057
- data/lib/ruby-lint/definitions/core/ruby_copyright.rb +1 -1
- data/lib/ruby-lint/definitions/core/ruby_description.rb +1 -1
- data/lib/ruby-lint/definitions/core/ruby_engine.rb +1 -1
- data/lib/ruby-lint/definitions/core/ruby_lint.rb +9 -9
- data/lib/ruby-lint/definitions/core/ruby_patchlevel.rb +1 -1
- data/lib/ruby-lint/definitions/core/ruby_platform.rb +1 -1
- data/lib/ruby-lint/definitions/core/ruby_release_date.rb +1 -1
- data/lib/ruby-lint/definitions/core/ruby_version.rb +1 -1
- data/lib/ruby-lint/definitions/core/runtime_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/scan_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/script_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/security_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/shellwords.rb +1 -1
- data/lib/ruby-lint/definitions/core/signal.rb +3 -3
- data/lib/ruby-lint/definitions/core/signal_exception.rb +2 -2
- data/lib/ruby-lint/definitions/core/singleton.rb +2 -2
- data/lib/ruby-lint/definitions/core/sized_queue.rb +2 -2
- data/lib/ruby-lint/definitions/core/standard_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/stderr.rb +1 -1
- data/lib/ruby-lint/definitions/core/stdin.rb +1 -1
- data/lib/ruby-lint/definitions/core/stdout.rb +1 -1
- data/lib/ruby-lint/definitions/core/stop_iteration.rb +2 -2
- data/lib/ruby-lint/definitions/core/string.rb +21 -21
- data/lib/ruby-lint/definitions/core/string_io.rb +7 -7
- data/lib/ruby-lint/definitions/core/string_scanner.rb +4 -4
- data/lib/ruby-lint/definitions/core/struct.rb +20 -20
- data/lib/ruby-lint/definitions/core/syck.rb +4 -4
- data/lib/ruby-lint/definitions/core/symbol.rb +2 -2
- data/lib/ruby-lint/definitions/core/syntax_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/system_call_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/system_exit.rb +2 -2
- data/lib/ruby-lint/definitions/core/system_stack_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/thread.rb +6 -6
- data/lib/ruby-lint/definitions/core/thread_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/thread_group.rb +2 -2
- data/lib/ruby-lint/definitions/core/time.rb +3 -3
- data/lib/ruby-lint/definitions/core/toplevel_binding.rb +1 -1
- data/lib/ruby-lint/definitions/core/true.rb +1 -1
- data/lib/ruby-lint/definitions/core/true_class.rb +2 -2
- data/lib/ruby-lint/definitions/core/type_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/unbound_method.rb +2 -2
- data/lib/ruby-lint/definitions/core/unmarshalable.rb +1 -1
- data/lib/ruby-lint/definitions/core/unsupported_library_error.rb +2 -2
- data/lib/ruby-lint/definitions/core/weak_ref.rb +4 -4
- data/lib/ruby-lint/definitions/core/zero_division_error.rb +2 -2
- data/lib/ruby-lint/definitions/rails.rb +12 -0
- data/lib/ruby-lint/definitions/rails/abstract_controller.rb +335 -0
- data/lib/ruby-lint/definitions/rails/action_controller.rb +1244 -0
- data/lib/ruby-lint/definitions/rails/action_dispatch.rb +741 -0
- data/lib/ruby-lint/definitions/rails/action_mailer.rb +502 -0
- data/lib/ruby-lint/definitions/rails/action_pack.rb +16 -0
- data/lib/ruby-lint/definitions/rails/action_view.rb +898 -0
- data/lib/ruby-lint/definitions/rails/active_model.rb +437 -0
- data/lib/ruby-lint/definitions/rails/active_record.rb +2901 -0
- data/lib/ruby-lint/definitions/rails/active_support.rb +1963 -0
- data/lib/ruby-lint/definitions/rails/arel.rb +665 -0
- data/lib/ruby-lint/definitions/rails/rails.rb +452 -0
- data/lib/ruby-lint/definitions/rails/sprockets.rb +968 -0
- data/lib/ruby-lint/generated_constant.rb +33 -0
- data/lib/ruby-lint/helper/constant_paths.rb +30 -21
- data/lib/ruby-lint/inspector.rb +20 -2
- data/lib/ruby-lint/iterator.rb +11 -171
- data/lib/ruby-lint/nested_stack.rb +46 -0
- data/lib/ruby-lint/parser.rb +24 -806
- data/lib/ruby-lint/report.rb +2 -30
- data/lib/ruby-lint/report/entry.rb +2 -2
- data/lib/ruby-lint/runner.rb +81 -0
- data/lib/ruby-lint/template/definition.erb +12 -8
- data/lib/ruby-lint/variable_predicates.rb +16 -58
- data/lib/ruby-lint/version.rb +1 -1
- data/lib/ruby-lint/virtual_machine.rb +1044 -0
- data/ruby-lint.gemspec +17 -7
- data/spec/fixtures/complex/rails/basic_controller.rb +9 -0
- data/spec/fixtures/complex/rcap.rb +38 -0
- data/spec/fixtures/complex/slop.rb +680 -0
- data/spec/fixtures/config.yml +8 -0
- data/spec/fixtures/invalid.rb +3 -0
- data/spec/fixtures/invalid_2.rb +3 -0
- data/spec/fixtures/syntax_error.rb +1 -0
- data/spec/fixtures/valid.rb +3 -0
- data/spec/helper.rb +6 -0
- data/spec/ruby-lint/{analyze → analysis}/argument_amount.rb +7 -7
- data/spec/ruby-lint/analysis/confusing_variables.rb +46 -0
- data/spec/ruby-lint/analysis/pedantics.rb +43 -0
- data/spec/ruby-lint/{analyze → analysis}/shadowing_variables.rb +5 -5
- data/spec/ruby-lint/{analyze → analysis}/undefined_methods.rb +18 -18
- data/spec/ruby-lint/{analyze → analysis}/undefined_variables.rb +19 -25
- data/spec/ruby-lint/{analyze → analysis}/unused_variables.rb +29 -16
- data/spec/ruby-lint/ast/node.rb +33 -0
- data/spec/ruby-lint/cli/analyze.rb +31 -0
- data/spec/ruby-lint/cli/ast.rb +23 -0
- data/spec/ruby-lint/configuration.rb +45 -6
- data/spec/ruby-lint/definition/constant_proxy.rb +31 -0
- data/spec/ruby-lint/definition/dsl.rb +13 -20
- data/spec/ruby-lint/definition/ruby_method.rb +65 -148
- data/spec/ruby-lint/definition/ruby_object.rb +60 -96
- data/spec/ruby-lint/definition_builder/primitive.rb +62 -0
- data/spec/ruby-lint/definition_builder/ruby_class.rb +108 -0
- data/spec/ruby-lint/definition_builder/ruby_method.rb +53 -0
- data/spec/ruby-lint/definition_builder/ruby_module.rb +50 -0
- data/spec/ruby-lint/iterator.rb +40 -16
- data/spec/ruby-lint/nested_stack.rb +23 -0
- data/spec/ruby-lint/parser.rb +14 -0
- data/spec/ruby-lint/report.rb +0 -10
- data/spec/ruby-lint/report/entry.rb +8 -4
- data/spec/ruby-lint/runner.rb +32 -0
- data/spec/ruby-lint/virtual_machine/assignments/arrays.rb +87 -0
- data/spec/ruby-lint/virtual_machine/assignments/hashes.rb +52 -0
- data/spec/ruby-lint/virtual_machine/assignments/optional.rb +41 -0
- data/spec/ruby-lint/{definitions_builder → virtual_machine}/assignments/return_values.rb +11 -11
- data/spec/ruby-lint/virtual_machine/assignments/variables.rb +85 -0
- data/spec/ruby-lint/virtual_machine/associate_nodes.rb +17 -0
- data/spec/ruby-lint/virtual_machine/autoloading.rb +31 -0
- data/spec/ruby-lint/virtual_machine/blocks.rb +64 -0
- data/spec/ruby-lint/virtual_machine/classes/class_methods.rb +21 -0
- data/spec/ruby-lint/virtual_machine/classes/extending.rb +104 -0
- data/spec/ruby-lint/virtual_machine/classes/redefining.rb +24 -0
- data/spec/ruby-lint/virtual_machine/classes/sclass.rb +94 -0
- data/spec/ruby-lint/virtual_machine/classes/scoping.rb +60 -0
- data/spec/ruby-lint/virtual_machine/complex/rails.rb +18 -0
- data/spec/ruby-lint/virtual_machine/complex/rcap.rb +15 -0
- data/spec/ruby-lint/virtual_machine/complex/slop.rb +16 -0
- data/spec/ruby-lint/{definitions_builder → virtual_machine}/for.rb +2 -2
- data/spec/ruby-lint/virtual_machine/freeze.rb +13 -0
- data/spec/ruby-lint/virtual_machine/interpolation.rb +12 -0
- data/spec/ruby-lint/virtual_machine/methods/defining.rb +40 -0
- data/spec/ruby-lint/virtual_machine/methods/exporting.rb +19 -0
- data/spec/ruby-lint/virtual_machine/methods/parameters.rb +77 -0
- data/spec/ruby-lint/virtual_machine/methods/patching.rb +26 -0
- data/spec/ruby-lint/virtual_machine/methods/scoping.rb +63 -0
- data/spec/ruby-lint/virtual_machine/methods/visibility.rb +64 -0
- data/spec/ruby-lint/{definitions_builder → virtual_machine}/modules.rb +16 -16
- data/spec/ruby-lint/virtual_machine/reference_amount.rb +33 -0
- data/spec/ruby-lint/virtual_machine/unused.rb +17 -0
- data/spec/support/bacon.rb +13 -13
- data/spec/support/building.rb +23 -16
- data/spec/support/coveralls.rb +5 -0
- data/spec/support/fixtures.rb +20 -0
- data/spec/support/parsing.rb +3 -5
- data/spec/support/simplecov.rb +5 -3
- data/task/build.rake +1 -1
- data/task/cop.rake +11 -0
- data/task/generate.rake +40 -2
- data/task/profile.rake +27 -0
- data/task/todo.rake +6 -0
- data/task/travis.rake +7 -0
- metadata +160 -75
- metadata.gz.asc +14 -14
- data/doc/build/.gitkeep +0 -0
- data/lib/ruby-lint/analyze/argument_amount.rb +0 -73
- data/lib/ruby-lint/analyze/shadowing_variables.rb +0 -32
- data/lib/ruby-lint/analyze/undefined_methods.rb +0 -68
- data/lib/ruby-lint/analyze/undefined_variables.rb +0 -72
- data/lib/ruby-lint/analyze/unused_variables.rb +0 -48
- data/lib/ruby-lint/base.rb +0 -85
- data/lib/ruby-lint/definitions_builder.rb +0 -692
- data/lib/ruby-lint/helper/conversion.rb +0 -33
- data/lib/ruby-lint/helper/current_scope.rb +0 -98
- data/lib/ruby-lint/helper/methods.rb +0 -91
- data/lib/ruby-lint/node.rb +0 -107
- data/lib/ruby-lint/parser_error.rb +0 -30
- data/spec/ruby-lint/constant_loader.rb +0 -32
- data/spec/ruby-lint/definition/method_calls.rb +0 -26
- data/spec/ruby-lint/definitions_builder/assignments/arrays.rb +0 -71
- data/spec/ruby-lint/definitions_builder/assignments/hashes.rb +0 -65
- data/spec/ruby-lint/definitions_builder/assignments/objects.rb +0 -23
- data/spec/ruby-lint/definitions_builder/assignments/optional.rb +0 -22
- data/spec/ruby-lint/definitions_builder/assignments/variables.rb +0 -71
- data/spec/ruby-lint/definitions_builder/associate_nodes.rb +0 -17
- data/spec/ruby-lint/definitions_builder/blocks.rb +0 -40
- data/spec/ruby-lint/definitions_builder/classes.rb +0 -230
- data/spec/ruby-lint/definitions_builder/methods.rb +0 -147
- data/spec/ruby-lint/definitions_builder/reference_amount.rb +0 -31
- data/spec/ruby-lint/definitions_builder/unused.rb +0 -15
- data/spec/ruby-lint/node.rb +0 -38
- data/spec/ruby-lint/parser/assignments.rb +0 -225
- data/spec/ruby-lint/parser/classes.rb +0 -110
- data/spec/ruby-lint/parser/errors.rb +0 -12
- data/spec/ruby-lint/parser/metadata.rb +0 -17
- data/spec/ruby-lint/parser/method_definitions.rb +0 -111
- data/spec/ruby-lint/parser/methods.rb +0 -217
- data/spec/ruby-lint/parser/modules.rb +0 -70
- data/spec/ruby-lint/parser/operators.rb +0 -40
- data/spec/ruby-lint/parser/statements/begin.rb +0 -55
- data/spec/ruby-lint/parser/statements/case.rb +0 -34
- data/spec/ruby-lint/parser/statements/defined.rb +0 -11
- data/spec/ruby-lint/parser/statements/for.rb +0 -34
- data/spec/ruby-lint/parser/statements/if.rb +0 -46
- data/spec/ruby-lint/parser/statements/return.rb +0 -14
- data/spec/ruby-lint/parser/statements/super.rb +0 -49
- data/spec/ruby-lint/parser/statements/unless.rb +0 -42
- data/spec/ruby-lint/parser/statements/until.rb +0 -25
- data/spec/ruby-lint/parser/statements/while.rb +0 -25
- data/spec/ruby-lint/parser/statements/yield.rb +0 -18
- data/spec/ruby-lint/parser/types/arrays.rb +0 -47
- data/spec/ruby-lint/parser/types/booleans.rb +0 -11
- data/spec/ruby-lint/parser/types/constants.rb +0 -32
- data/spec/ruby-lint/parser/types/hashes.rb +0 -55
- data/spec/ruby-lint/parser/types/nil.rb +0 -7
- data/spec/ruby-lint/parser/types/numbers.rb +0 -11
- data/spec/ruby-lint/parser/types/procs.rb +0 -11
- data/spec/ruby-lint/parser/types/ranges.rb +0 -11
- data/spec/ruby-lint/parser/types/regexp.rb +0 -27
- data/spec/ruby-lint/parser/types/strings.rb +0 -44
- data/spec/ruby-lint/parser/types/symbols.rb +0 -15
- data/task/stdlib.rake +0 -23
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
# This file was automatically generated, any manual changes will be lost the
|
|
2
|
+
# next time this file is generated.
|
|
3
|
+
#
|
|
4
|
+
# Created: 2013-07-07 17:54:58 +0200
|
|
5
|
+
# Platform: rbx 2.0.0.rc1
|
|
6
|
+
|
|
7
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel') do |klass|
|
|
8
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
9
|
+
|
|
10
|
+
klass.define_method('version')
|
|
11
|
+
|
|
12
|
+
klass.define_instance_method('eager_load!')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::AttributeMethods') do |klass|
|
|
16
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
17
|
+
|
|
18
|
+
klass.define_instance_method('attribute_method?') do |method|
|
|
19
|
+
method.define_argument('attr_name')
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
klass.define_instance_method('attribute_missing') do |method|
|
|
23
|
+
method.define_argument('match')
|
|
24
|
+
method.define_rest_argument('args')
|
|
25
|
+
method.define_block_argument('block')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
klass.define_instance_method('method_missing') do |method|
|
|
29
|
+
method.define_argument('method')
|
|
30
|
+
method.define_rest_argument('args')
|
|
31
|
+
method.define_block_argument('block')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
klass.define_instance_method('respond_to?') do |method|
|
|
35
|
+
method.define_argument('method')
|
|
36
|
+
method.define_optional_argument('include_private_methods')
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
klass.define_instance_method('respond_to_without_attributes?') do |method|
|
|
40
|
+
method.define_argument('meth')
|
|
41
|
+
method.define_optional_argument('include_private')
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::BlockValidator') do |klass|
|
|
46
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveModel::EachValidator'))
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Callbacks') do |klass|
|
|
50
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
51
|
+
|
|
52
|
+
klass.define_method('extended') do |method|
|
|
53
|
+
method.define_argument('base')
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
klass.define_instance_method('define_model_callbacks') do |method|
|
|
57
|
+
method.define_rest_argument('callbacks')
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Conversion') do |klass|
|
|
62
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
63
|
+
|
|
64
|
+
klass.define_instance_method('to_key')
|
|
65
|
+
|
|
66
|
+
klass.define_instance_method('to_model')
|
|
67
|
+
|
|
68
|
+
klass.define_instance_method('to_param')
|
|
69
|
+
|
|
70
|
+
klass.define_instance_method('to_partial_path')
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::DeprecatedMassAssignmentSecurity') do |klass|
|
|
74
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Dirty') do |klass|
|
|
78
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
79
|
+
|
|
80
|
+
klass.define_instance_method('changed')
|
|
81
|
+
|
|
82
|
+
klass.define_instance_method('changed?')
|
|
83
|
+
|
|
84
|
+
klass.define_instance_method('changed_attributes')
|
|
85
|
+
|
|
86
|
+
klass.define_instance_method('changes')
|
|
87
|
+
|
|
88
|
+
klass.define_instance_method('previous_changes')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::EachValidator') do |klass|
|
|
92
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveModel::Validator'))
|
|
93
|
+
|
|
94
|
+
klass.define_instance_method('attributes')
|
|
95
|
+
|
|
96
|
+
klass.define_instance_method('check_validity!')
|
|
97
|
+
|
|
98
|
+
klass.define_instance_method('validate') do |method|
|
|
99
|
+
method.define_argument('record')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
klass.define_instance_method('validate_each') do |method|
|
|
103
|
+
method.define_argument('record')
|
|
104
|
+
method.define_argument('attribute')
|
|
105
|
+
method.define_argument('value')
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Errors') do |klass|
|
|
110
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
111
|
+
|
|
112
|
+
klass.define_instance_method('[]') do |method|
|
|
113
|
+
method.define_argument('attribute')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
klass.define_instance_method('[]=') do |method|
|
|
117
|
+
method.define_argument('attribute')
|
|
118
|
+
method.define_argument('error')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
klass.define_instance_method('add') do |method|
|
|
122
|
+
method.define_argument('attribute')
|
|
123
|
+
method.define_optional_argument('message')
|
|
124
|
+
method.define_optional_argument('options')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
klass.define_instance_method('add_on_blank') do |method|
|
|
128
|
+
method.define_argument('attributes')
|
|
129
|
+
method.define_optional_argument('options')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
klass.define_instance_method('add_on_empty') do |method|
|
|
133
|
+
method.define_argument('attributes')
|
|
134
|
+
method.define_optional_argument('options')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
klass.define_instance_method('added?') do |method|
|
|
138
|
+
method.define_argument('attribute')
|
|
139
|
+
method.define_optional_argument('message')
|
|
140
|
+
method.define_optional_argument('options')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
klass.define_instance_method('as_json') do |method|
|
|
144
|
+
method.define_optional_argument('options')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
klass.define_instance_method('blank?')
|
|
148
|
+
|
|
149
|
+
klass.define_instance_method('clear')
|
|
150
|
+
|
|
151
|
+
klass.define_instance_method('count')
|
|
152
|
+
|
|
153
|
+
klass.define_instance_method('delete') do |method|
|
|
154
|
+
method.define_argument('key')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
klass.define_instance_method('each')
|
|
158
|
+
|
|
159
|
+
klass.define_instance_method('empty?')
|
|
160
|
+
|
|
161
|
+
klass.define_instance_method('full_message') do |method|
|
|
162
|
+
method.define_argument('attribute')
|
|
163
|
+
method.define_argument('message')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
klass.define_instance_method('full_messages')
|
|
167
|
+
|
|
168
|
+
klass.define_instance_method('full_messages_for') do |method|
|
|
169
|
+
method.define_argument('attribute')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
klass.define_instance_method('generate_message') do |method|
|
|
173
|
+
method.define_argument('attribute')
|
|
174
|
+
method.define_optional_argument('type')
|
|
175
|
+
method.define_optional_argument('options')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
klass.define_instance_method('get') do |method|
|
|
179
|
+
method.define_argument('key')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
klass.define_instance_method('has_key?') do |method|
|
|
183
|
+
method.define_argument('attribute')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
klass.define_instance_method('include?') do |method|
|
|
187
|
+
method.define_argument('attribute')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
klass.define_instance_method('initialize_dup') do |method|
|
|
191
|
+
method.define_argument('other')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
klass.define_instance_method('keys')
|
|
195
|
+
|
|
196
|
+
klass.define_instance_method('messages')
|
|
197
|
+
|
|
198
|
+
klass.define_instance_method('set') do |method|
|
|
199
|
+
method.define_argument('key')
|
|
200
|
+
method.define_argument('value')
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
klass.define_instance_method('size')
|
|
204
|
+
|
|
205
|
+
klass.define_instance_method('to_a')
|
|
206
|
+
|
|
207
|
+
klass.define_instance_method('to_hash') do |method|
|
|
208
|
+
method.define_optional_argument('full_messages')
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
klass.define_instance_method('to_xml') do |method|
|
|
212
|
+
method.define_optional_argument('options')
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
klass.define_instance_method('values')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::ForbiddenAttributesProtection') do |klass|
|
|
219
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
220
|
+
|
|
221
|
+
klass.define_instance_method('sanitize_for_mass_assignment') do |method|
|
|
222
|
+
method.define_argument('attributes')
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Lint') do |klass|
|
|
227
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::MissingAttributeError') do |klass|
|
|
231
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('NoMethodError'))
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Model') do |klass|
|
|
235
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
236
|
+
|
|
237
|
+
klass.define_method('included') do |method|
|
|
238
|
+
method.define_argument('base')
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
klass.define_instance_method('persisted?')
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Name') do |klass|
|
|
245
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
246
|
+
|
|
247
|
+
klass.define_instance_method('!~') do |method|
|
|
248
|
+
method.define_rest_argument('args')
|
|
249
|
+
method.define_block_argument('block')
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
klass.define_instance_method('<=>') do |method|
|
|
253
|
+
method.define_rest_argument('args')
|
|
254
|
+
method.define_block_argument('block')
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
klass.define_instance_method('==') do |method|
|
|
258
|
+
method.define_argument('arg')
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
klass.define_instance_method('===') do |method|
|
|
262
|
+
method.define_argument('arg')
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
klass.define_instance_method('=~') do |method|
|
|
266
|
+
method.define_rest_argument('args')
|
|
267
|
+
method.define_block_argument('block')
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
klass.define_instance_method('cache_key')
|
|
271
|
+
|
|
272
|
+
klass.define_instance_method('collection')
|
|
273
|
+
|
|
274
|
+
klass.define_instance_method('element')
|
|
275
|
+
|
|
276
|
+
klass.define_instance_method('eql?') do |method|
|
|
277
|
+
method.define_rest_argument('args')
|
|
278
|
+
method.define_block_argument('block')
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
klass.define_instance_method('human') do |method|
|
|
282
|
+
method.define_optional_argument('options')
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
klass.define_instance_method('i18n_key')
|
|
286
|
+
|
|
287
|
+
klass.define_instance_method('name')
|
|
288
|
+
|
|
289
|
+
klass.define_instance_method('param_key')
|
|
290
|
+
|
|
291
|
+
klass.define_instance_method('plural')
|
|
292
|
+
|
|
293
|
+
klass.define_instance_method('route_key')
|
|
294
|
+
|
|
295
|
+
klass.define_instance_method('singular')
|
|
296
|
+
|
|
297
|
+
klass.define_instance_method('singular_route_key')
|
|
298
|
+
|
|
299
|
+
klass.define_instance_method('to_s') do |method|
|
|
300
|
+
method.define_rest_argument('args')
|
|
301
|
+
method.define_block_argument('block')
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
klass.define_instance_method('to_str') do |method|
|
|
305
|
+
method.define_rest_argument('args')
|
|
306
|
+
method.define_block_argument('block')
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Naming') do |klass|
|
|
311
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
312
|
+
|
|
313
|
+
klass.define_method('param_key') do |method|
|
|
314
|
+
method.define_argument('record_or_class')
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
klass.define_method('plural') do |method|
|
|
318
|
+
method.define_argument('record_or_class')
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
klass.define_method('route_key') do |method|
|
|
322
|
+
method.define_argument('record_or_class')
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
klass.define_method('singular') do |method|
|
|
326
|
+
method.define_argument('record_or_class')
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
klass.define_method('singular_route_key') do |method|
|
|
330
|
+
method.define_argument('record_or_class')
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
klass.define_method('uncountable?') do |method|
|
|
334
|
+
method.define_argument('record_or_class')
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
klass.define_instance_method('model_name')
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Railtie') do |klass|
|
|
341
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Rails::Railtie'))
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::SecurePassword') do |klass|
|
|
345
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
346
|
+
|
|
347
|
+
klass.define_method('min_cost')
|
|
348
|
+
|
|
349
|
+
klass.define_method('min_cost=')
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Serialization') do |klass|
|
|
353
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
354
|
+
|
|
355
|
+
klass.define_instance_method('read_attribute_for_serialization') do |method|
|
|
356
|
+
method.define_argument('message')
|
|
357
|
+
method.define_rest_argument('args')
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
klass.define_instance_method('serializable_hash') do |method|
|
|
361
|
+
method.define_optional_argument('options')
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Serializers') do |klass|
|
|
366
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::StrictValidationFailed') do |klass|
|
|
370
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('StandardError'))
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::TestCase') do |klass|
|
|
374
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveSupport::TestCase'))
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Translation') do |klass|
|
|
378
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
379
|
+
|
|
380
|
+
klass.define_instance_method('human_attribute_name') do |method|
|
|
381
|
+
method.define_argument('attribute')
|
|
382
|
+
method.define_optional_argument('options')
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
klass.define_instance_method('i18n_scope')
|
|
386
|
+
|
|
387
|
+
klass.define_instance_method('lookup_ancestors')
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::VERSION') do |klass|
|
|
391
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Validations') do |klass|
|
|
395
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
396
|
+
|
|
397
|
+
klass.define_instance_method('errors')
|
|
398
|
+
|
|
399
|
+
klass.define_instance_method('initialize_dup') do |method|
|
|
400
|
+
method.define_argument('other')
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
klass.define_instance_method('invalid?') do |method|
|
|
404
|
+
method.define_optional_argument('context')
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
klass.define_instance_method('read_attribute_for_validation') do |method|
|
|
408
|
+
method.define_argument('message')
|
|
409
|
+
method.define_rest_argument('args')
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
klass.define_instance_method('run_validations!')
|
|
413
|
+
|
|
414
|
+
klass.define_instance_method('valid?') do |method|
|
|
415
|
+
method.define_optional_argument('context')
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
klass.define_instance_method('validates_with') do |method|
|
|
419
|
+
method.define_rest_argument('args')
|
|
420
|
+
method.define_block_argument('block')
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveModel::Validator') do |klass|
|
|
425
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
426
|
+
|
|
427
|
+
klass.define_method('kind')
|
|
428
|
+
|
|
429
|
+
klass.define_instance_method('kind')
|
|
430
|
+
|
|
431
|
+
klass.define_instance_method('options')
|
|
432
|
+
|
|
433
|
+
klass.define_instance_method('validate') do |method|
|
|
434
|
+
method.define_argument('record')
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
|
|
@@ -0,0 +1,2901 @@
|
|
|
1
|
+
# This file was automatically generated, any manual changes will be lost the
|
|
2
|
+
# next time this file is generated.
|
|
3
|
+
#
|
|
4
|
+
# Created: 2013-07-07 17:54:58 +0200
|
|
5
|
+
# Platform: rbx 2.0.0.rc1
|
|
6
|
+
|
|
7
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord') do |klass|
|
|
8
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
9
|
+
|
|
10
|
+
klass.define_method('eager_load!')
|
|
11
|
+
|
|
12
|
+
klass.define_method('version')
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ActiveRecordError') do |klass|
|
|
16
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('StandardError'))
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AdapterNotFound') do |klass|
|
|
20
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AdapterNotSpecified') do |klass|
|
|
24
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Aggregations') do |klass|
|
|
28
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
29
|
+
|
|
30
|
+
klass.define_instance_method('clear_aggregation_cache')
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AssociationTypeMismatch') do |klass|
|
|
34
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Associations') do |klass|
|
|
38
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
39
|
+
|
|
40
|
+
klass.define_instance_method('association') do |method|
|
|
41
|
+
method.define_argument('name')
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
klass.define_instance_method('association_cache')
|
|
45
|
+
|
|
46
|
+
klass.define_instance_method('clear_association_cache')
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AttributeAssignment') do |klass|
|
|
50
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
51
|
+
|
|
52
|
+
klass.define_instance_method('assign_attributes') do |method|
|
|
53
|
+
method.define_argument('new_attributes')
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
klass.define_instance_method('attributes=') do |method|
|
|
57
|
+
method.define_argument('new_attributes')
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AttributeAssignmentError') do |klass|
|
|
62
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
63
|
+
|
|
64
|
+
klass.define_instance_method('attribute')
|
|
65
|
+
|
|
66
|
+
klass.define_instance_method('exception')
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AttributeMethods') do |klass|
|
|
70
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
71
|
+
|
|
72
|
+
klass.define_instance_method('[]') do |method|
|
|
73
|
+
method.define_argument('attr_name')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
klass.define_instance_method('[]=') do |method|
|
|
77
|
+
method.define_argument('attr_name')
|
|
78
|
+
method.define_argument('value')
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
klass.define_instance_method('arel_attributes_with_values_for_create') do |method|
|
|
82
|
+
method.define_argument('attribute_names')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
klass.define_instance_method('arel_attributes_with_values_for_update') do |method|
|
|
86
|
+
method.define_argument('attribute_names')
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
klass.define_instance_method('attribute_for_inspect') do |method|
|
|
90
|
+
method.define_argument('attr_name')
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
klass.define_instance_method('attribute_method?') do |method|
|
|
94
|
+
method.define_argument('attr_name')
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
klass.define_instance_method('attribute_missing') do |method|
|
|
98
|
+
method.define_argument('match')
|
|
99
|
+
method.define_rest_argument('args')
|
|
100
|
+
method.define_block_argument('block')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
klass.define_instance_method('attribute_names')
|
|
104
|
+
|
|
105
|
+
klass.define_instance_method('attribute_present?') do |method|
|
|
106
|
+
method.define_argument('attribute')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
klass.define_instance_method('attributes')
|
|
110
|
+
|
|
111
|
+
klass.define_instance_method('clone_attribute_value') do |method|
|
|
112
|
+
method.define_argument('reader_method')
|
|
113
|
+
method.define_argument('attribute_name')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
klass.define_instance_method('clone_attributes') do |method|
|
|
117
|
+
method.define_optional_argument('reader_method')
|
|
118
|
+
method.define_optional_argument('attributes')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
klass.define_instance_method('column_for_attribute') do |method|
|
|
122
|
+
method.define_argument('name')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
klass.define_instance_method('has_attribute?') do |method|
|
|
126
|
+
method.define_argument('attr_name')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
klass.define_instance_method('method_missing') do |method|
|
|
130
|
+
method.define_argument('method')
|
|
131
|
+
method.define_rest_argument('args')
|
|
132
|
+
method.define_block_argument('block')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
klass.define_instance_method('respond_to?') do |method|
|
|
136
|
+
method.define_argument('name')
|
|
137
|
+
method.define_optional_argument('include_private')
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::AutosaveAssociation') do |klass|
|
|
142
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
143
|
+
|
|
144
|
+
klass.define_instance_method('changed_for_autosave?')
|
|
145
|
+
|
|
146
|
+
klass.define_instance_method('destroyed_by_association')
|
|
147
|
+
|
|
148
|
+
klass.define_instance_method('destroyed_by_association=') do |method|
|
|
149
|
+
method.define_argument('reflection')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
klass.define_instance_method('mark_for_destruction')
|
|
153
|
+
|
|
154
|
+
klass.define_instance_method('marked_for_destruction?')
|
|
155
|
+
|
|
156
|
+
klass.define_instance_method('reload') do |method|
|
|
157
|
+
method.define_optional_argument('options')
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Base') do |klass|
|
|
162
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
163
|
+
|
|
164
|
+
klass.define_method('_attr_readonly')
|
|
165
|
+
|
|
166
|
+
klass.define_method('_attr_readonly=') do |method|
|
|
167
|
+
method.define_argument('val')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
klass.define_method('_attr_readonly?')
|
|
171
|
+
|
|
172
|
+
klass.define_method('_commit_callbacks')
|
|
173
|
+
|
|
174
|
+
klass.define_method('_commit_callbacks=') do |method|
|
|
175
|
+
method.define_argument('val')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
klass.define_method('_commit_callbacks?')
|
|
179
|
+
|
|
180
|
+
klass.define_method('_create_callbacks')
|
|
181
|
+
|
|
182
|
+
klass.define_method('_create_callbacks=') do |method|
|
|
183
|
+
method.define_argument('val')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
klass.define_method('_create_callbacks?')
|
|
187
|
+
|
|
188
|
+
klass.define_method('_destroy_callbacks')
|
|
189
|
+
|
|
190
|
+
klass.define_method('_destroy_callbacks=') do |method|
|
|
191
|
+
method.define_argument('val')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
klass.define_method('_destroy_callbacks?')
|
|
195
|
+
|
|
196
|
+
klass.define_method('_find_callbacks')
|
|
197
|
+
|
|
198
|
+
klass.define_method('_find_callbacks=') do |method|
|
|
199
|
+
method.define_argument('val')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
klass.define_method('_find_callbacks?')
|
|
203
|
+
|
|
204
|
+
klass.define_method('_initialize_callbacks')
|
|
205
|
+
|
|
206
|
+
klass.define_method('_initialize_callbacks=') do |method|
|
|
207
|
+
method.define_argument('val')
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
klass.define_method('_initialize_callbacks?')
|
|
211
|
+
|
|
212
|
+
klass.define_method('_rollback_callbacks')
|
|
213
|
+
|
|
214
|
+
klass.define_method('_rollback_callbacks=') do |method|
|
|
215
|
+
method.define_argument('val')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
klass.define_method('_rollback_callbacks?')
|
|
219
|
+
|
|
220
|
+
klass.define_method('_save_callbacks')
|
|
221
|
+
|
|
222
|
+
klass.define_method('_save_callbacks=') do |method|
|
|
223
|
+
method.define_argument('val')
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
klass.define_method('_save_callbacks?')
|
|
227
|
+
|
|
228
|
+
klass.define_method('_touch_callbacks')
|
|
229
|
+
|
|
230
|
+
klass.define_method('_touch_callbacks=') do |method|
|
|
231
|
+
method.define_argument('val')
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
klass.define_method('_touch_callbacks?')
|
|
235
|
+
|
|
236
|
+
klass.define_method('_update_callbacks')
|
|
237
|
+
|
|
238
|
+
klass.define_method('_update_callbacks=') do |method|
|
|
239
|
+
method.define_argument('val')
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
klass.define_method('_update_callbacks?')
|
|
243
|
+
|
|
244
|
+
klass.define_method('_validate_callbacks')
|
|
245
|
+
|
|
246
|
+
klass.define_method('_validate_callbacks=') do |method|
|
|
247
|
+
method.define_argument('val')
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
klass.define_method('_validate_callbacks?')
|
|
251
|
+
|
|
252
|
+
klass.define_method('_validation_callbacks')
|
|
253
|
+
|
|
254
|
+
klass.define_method('_validation_callbacks=') do |method|
|
|
255
|
+
method.define_argument('val')
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
klass.define_method('_validation_callbacks?')
|
|
259
|
+
|
|
260
|
+
klass.define_method('_validators')
|
|
261
|
+
|
|
262
|
+
klass.define_method('_validators=') do |method|
|
|
263
|
+
method.define_argument('val')
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
klass.define_method('_validators?')
|
|
267
|
+
|
|
268
|
+
klass.define_method('after_create') do |method|
|
|
269
|
+
method.define_rest_argument('args')
|
|
270
|
+
method.define_block_argument('block')
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
klass.define_method('after_destroy') do |method|
|
|
274
|
+
method.define_rest_argument('args')
|
|
275
|
+
method.define_block_argument('block')
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
klass.define_method('after_find') do |method|
|
|
279
|
+
method.define_rest_argument('args')
|
|
280
|
+
method.define_block_argument('block')
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
klass.define_method('after_initialize') do |method|
|
|
284
|
+
method.define_rest_argument('args')
|
|
285
|
+
method.define_block_argument('block')
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
klass.define_method('after_save') do |method|
|
|
289
|
+
method.define_rest_argument('args')
|
|
290
|
+
method.define_block_argument('block')
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
klass.define_method('after_touch') do |method|
|
|
294
|
+
method.define_rest_argument('args')
|
|
295
|
+
method.define_block_argument('block')
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
klass.define_method('after_update') do |method|
|
|
299
|
+
method.define_rest_argument('args')
|
|
300
|
+
method.define_block_argument('block')
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
klass.define_method('around_create') do |method|
|
|
304
|
+
method.define_rest_argument('args')
|
|
305
|
+
method.define_block_argument('block')
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
klass.define_method('around_destroy') do |method|
|
|
309
|
+
method.define_rest_argument('args')
|
|
310
|
+
method.define_block_argument('block')
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
klass.define_method('around_save') do |method|
|
|
314
|
+
method.define_rest_argument('args')
|
|
315
|
+
method.define_block_argument('block')
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
klass.define_method('around_update') do |method|
|
|
319
|
+
method.define_rest_argument('args')
|
|
320
|
+
method.define_block_argument('block')
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
klass.define_method('attribute_aliases')
|
|
324
|
+
|
|
325
|
+
klass.define_method('attribute_aliases=') do |method|
|
|
326
|
+
method.define_argument('val')
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
klass.define_method('attribute_aliases?')
|
|
330
|
+
|
|
331
|
+
klass.define_method('attribute_method_matchers')
|
|
332
|
+
|
|
333
|
+
klass.define_method('attribute_method_matchers=') do |method|
|
|
334
|
+
method.define_argument('val')
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
klass.define_method('attribute_method_matchers?')
|
|
338
|
+
|
|
339
|
+
klass.define_method('attribute_types_cached_by_default')
|
|
340
|
+
|
|
341
|
+
klass.define_method('attribute_types_cached_by_default=') do |method|
|
|
342
|
+
method.define_argument('val')
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
klass.define_method('attribute_types_cached_by_default?')
|
|
346
|
+
|
|
347
|
+
klass.define_method('before_create') do |method|
|
|
348
|
+
method.define_rest_argument('args')
|
|
349
|
+
method.define_block_argument('block')
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
klass.define_method('before_destroy') do |method|
|
|
353
|
+
method.define_rest_argument('args')
|
|
354
|
+
method.define_block_argument('block')
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
klass.define_method('before_save') do |method|
|
|
358
|
+
method.define_rest_argument('args')
|
|
359
|
+
method.define_block_argument('block')
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
klass.define_method('before_update') do |method|
|
|
363
|
+
method.define_rest_argument('args')
|
|
364
|
+
method.define_block_argument('block')
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
klass.define_method('cache_timestamp_format')
|
|
368
|
+
|
|
369
|
+
klass.define_method('cache_timestamp_format=') do |method|
|
|
370
|
+
method.define_argument('val')
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
klass.define_method('cache_timestamp_format?')
|
|
374
|
+
|
|
375
|
+
klass.define_method('configurations')
|
|
376
|
+
|
|
377
|
+
klass.define_method('configurations=') do |method|
|
|
378
|
+
method.define_argument('obj')
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
klass.define_method('connection_handler')
|
|
382
|
+
|
|
383
|
+
klass.define_method('connection_handler=') do |method|
|
|
384
|
+
method.define_argument('handler')
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
klass.define_method('default_connection_handler')
|
|
388
|
+
|
|
389
|
+
klass.define_method('default_connection_handler=') do |method|
|
|
390
|
+
method.define_argument('val')
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
klass.define_method('default_connection_handler?')
|
|
394
|
+
|
|
395
|
+
klass.define_method('default_scopes')
|
|
396
|
+
|
|
397
|
+
klass.define_method('default_scopes=') do |method|
|
|
398
|
+
method.define_argument('val')
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
klass.define_method('default_scopes?')
|
|
402
|
+
|
|
403
|
+
klass.define_method('default_timezone')
|
|
404
|
+
|
|
405
|
+
klass.define_method('default_timezone=') do |method|
|
|
406
|
+
method.define_argument('obj')
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
klass.define_method('disable_implicit_join_references')
|
|
410
|
+
|
|
411
|
+
klass.define_method('disable_implicit_join_references=') do |method|
|
|
412
|
+
method.define_argument('obj')
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
klass.define_method('include_root_in_json')
|
|
416
|
+
|
|
417
|
+
klass.define_method('include_root_in_json=') do |method|
|
|
418
|
+
method.define_argument('val')
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
klass.define_method('include_root_in_json?')
|
|
422
|
+
|
|
423
|
+
klass.define_method('lock_optimistically')
|
|
424
|
+
|
|
425
|
+
klass.define_method('lock_optimistically=') do |method|
|
|
426
|
+
method.define_argument('val')
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
klass.define_method('lock_optimistically?')
|
|
430
|
+
|
|
431
|
+
klass.define_method('logger')
|
|
432
|
+
|
|
433
|
+
klass.define_method('logger=') do |method|
|
|
434
|
+
method.define_argument('obj')
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
klass.define_method('nested_attributes_options')
|
|
438
|
+
|
|
439
|
+
klass.define_method('nested_attributes_options=') do |method|
|
|
440
|
+
method.define_argument('val')
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
klass.define_method('nested_attributes_options?')
|
|
444
|
+
|
|
445
|
+
klass.define_method('partial_updates') do |method|
|
|
446
|
+
method.define_rest_argument('args')
|
|
447
|
+
method.define_block_argument('block')
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
klass.define_method('partial_updates=') do |method|
|
|
451
|
+
method.define_rest_argument('args')
|
|
452
|
+
method.define_block_argument('block')
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
klass.define_method('partial_updates?') do |method|
|
|
456
|
+
method.define_rest_argument('args')
|
|
457
|
+
method.define_block_argument('block')
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
klass.define_method('partial_updates_with_deprecation') do |method|
|
|
461
|
+
method.define_rest_argument('args')
|
|
462
|
+
method.define_block_argument('block')
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
klass.define_method('partial_updates_with_deprecation=') do |method|
|
|
466
|
+
method.define_rest_argument('args')
|
|
467
|
+
method.define_block_argument('block')
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
klass.define_method('partial_updates_with_deprecation?') do |method|
|
|
471
|
+
method.define_rest_argument('args')
|
|
472
|
+
method.define_block_argument('block')
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
klass.define_method('partial_updates_without_deprecation')
|
|
476
|
+
|
|
477
|
+
klass.define_method('partial_updates_without_deprecation=') do |method|
|
|
478
|
+
method.define_argument('v')
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
klass.define_method('partial_updates_without_deprecation?')
|
|
482
|
+
|
|
483
|
+
klass.define_method('partial_writes')
|
|
484
|
+
|
|
485
|
+
klass.define_method('partial_writes=') do |method|
|
|
486
|
+
method.define_argument('val')
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
klass.define_method('partial_writes?')
|
|
490
|
+
|
|
491
|
+
klass.define_method('pluralize_table_names')
|
|
492
|
+
|
|
493
|
+
klass.define_method('pluralize_table_names=') do |method|
|
|
494
|
+
method.define_argument('val')
|
|
495
|
+
end
|
|
496
|
+
|
|
497
|
+
klass.define_method('pluralize_table_names?')
|
|
498
|
+
|
|
499
|
+
klass.define_method('primary_key_prefix_type')
|
|
500
|
+
|
|
501
|
+
klass.define_method('primary_key_prefix_type=') do |method|
|
|
502
|
+
method.define_argument('obj')
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
klass.define_method('record_timestamps')
|
|
506
|
+
|
|
507
|
+
klass.define_method('record_timestamps=') do |method|
|
|
508
|
+
method.define_argument('val')
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
klass.define_method('record_timestamps?')
|
|
512
|
+
|
|
513
|
+
klass.define_method('reflections')
|
|
514
|
+
|
|
515
|
+
klass.define_method('reflections=') do |method|
|
|
516
|
+
method.define_argument('val')
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
klass.define_method('reflections?')
|
|
520
|
+
|
|
521
|
+
klass.define_method('schema_format')
|
|
522
|
+
|
|
523
|
+
klass.define_method('schema_format=') do |method|
|
|
524
|
+
method.define_argument('obj')
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
klass.define_method('serialized_attributes')
|
|
528
|
+
|
|
529
|
+
klass.define_method('serialized_attributes=') do |method|
|
|
530
|
+
method.define_argument('val')
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
klass.define_method('serialized_attributes?')
|
|
534
|
+
|
|
535
|
+
klass.define_method('skip_time_zone_conversion_for_attributes')
|
|
536
|
+
|
|
537
|
+
klass.define_method('skip_time_zone_conversion_for_attributes=') do |method|
|
|
538
|
+
method.define_argument('val')
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
klass.define_method('skip_time_zone_conversion_for_attributes?')
|
|
542
|
+
|
|
543
|
+
klass.define_method('store_full_sti_class')
|
|
544
|
+
|
|
545
|
+
klass.define_method('store_full_sti_class=') do |method|
|
|
546
|
+
method.define_argument('val')
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
klass.define_method('store_full_sti_class?')
|
|
550
|
+
|
|
551
|
+
klass.define_method('stored_attributes')
|
|
552
|
+
|
|
553
|
+
klass.define_method('stored_attributes=') do |method|
|
|
554
|
+
method.define_argument('val')
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
klass.define_method('stored_attributes?')
|
|
558
|
+
|
|
559
|
+
klass.define_method('table_name_prefix')
|
|
560
|
+
|
|
561
|
+
klass.define_method('table_name_prefix=') do |method|
|
|
562
|
+
method.define_argument('val')
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
klass.define_method('table_name_prefix?')
|
|
566
|
+
|
|
567
|
+
klass.define_method('table_name_suffix')
|
|
568
|
+
|
|
569
|
+
klass.define_method('table_name_suffix=') do |method|
|
|
570
|
+
method.define_argument('val')
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
klass.define_method('table_name_suffix?')
|
|
574
|
+
|
|
575
|
+
klass.define_method('time_zone_aware_attributes')
|
|
576
|
+
|
|
577
|
+
klass.define_method('time_zone_aware_attributes=') do |method|
|
|
578
|
+
method.define_argument('obj')
|
|
579
|
+
end
|
|
580
|
+
|
|
581
|
+
klass.define_method('timestamped_migrations')
|
|
582
|
+
|
|
583
|
+
klass.define_method('timestamped_migrations=') do |method|
|
|
584
|
+
method.define_argument('obj')
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
klass.define_instance_method('_commit_callbacks')
|
|
588
|
+
|
|
589
|
+
klass.define_instance_method('_commit_callbacks=')
|
|
590
|
+
|
|
591
|
+
klass.define_instance_method('_commit_callbacks?')
|
|
592
|
+
|
|
593
|
+
klass.define_instance_method('_create_callbacks')
|
|
594
|
+
|
|
595
|
+
klass.define_instance_method('_create_callbacks=')
|
|
596
|
+
|
|
597
|
+
klass.define_instance_method('_create_callbacks?')
|
|
598
|
+
|
|
599
|
+
klass.define_instance_method('_destroy_callbacks')
|
|
600
|
+
|
|
601
|
+
klass.define_instance_method('_destroy_callbacks=')
|
|
602
|
+
|
|
603
|
+
klass.define_instance_method('_destroy_callbacks?')
|
|
604
|
+
|
|
605
|
+
klass.define_instance_method('_find_callbacks')
|
|
606
|
+
|
|
607
|
+
klass.define_instance_method('_find_callbacks=')
|
|
608
|
+
|
|
609
|
+
klass.define_instance_method('_find_callbacks?')
|
|
610
|
+
|
|
611
|
+
klass.define_instance_method('_initialize_callbacks')
|
|
612
|
+
|
|
613
|
+
klass.define_instance_method('_initialize_callbacks=')
|
|
614
|
+
|
|
615
|
+
klass.define_instance_method('_initialize_callbacks?')
|
|
616
|
+
|
|
617
|
+
klass.define_instance_method('_rollback_callbacks')
|
|
618
|
+
|
|
619
|
+
klass.define_instance_method('_rollback_callbacks=')
|
|
620
|
+
|
|
621
|
+
klass.define_instance_method('_rollback_callbacks?')
|
|
622
|
+
|
|
623
|
+
klass.define_instance_method('_save_callbacks')
|
|
624
|
+
|
|
625
|
+
klass.define_instance_method('_save_callbacks=')
|
|
626
|
+
|
|
627
|
+
klass.define_instance_method('_save_callbacks?')
|
|
628
|
+
|
|
629
|
+
klass.define_instance_method('_touch_callbacks')
|
|
630
|
+
|
|
631
|
+
klass.define_instance_method('_touch_callbacks=')
|
|
632
|
+
|
|
633
|
+
klass.define_instance_method('_touch_callbacks?')
|
|
634
|
+
|
|
635
|
+
klass.define_instance_method('_update_callbacks')
|
|
636
|
+
|
|
637
|
+
klass.define_instance_method('_update_callbacks=')
|
|
638
|
+
|
|
639
|
+
klass.define_instance_method('_update_callbacks?')
|
|
640
|
+
|
|
641
|
+
klass.define_instance_method('_validate_callbacks')
|
|
642
|
+
|
|
643
|
+
klass.define_instance_method('_validate_callbacks=')
|
|
644
|
+
|
|
645
|
+
klass.define_instance_method('_validate_callbacks?')
|
|
646
|
+
|
|
647
|
+
klass.define_instance_method('_validation_callbacks')
|
|
648
|
+
|
|
649
|
+
klass.define_instance_method('_validation_callbacks=')
|
|
650
|
+
|
|
651
|
+
klass.define_instance_method('_validation_callbacks?')
|
|
652
|
+
|
|
653
|
+
klass.define_instance_method('_validators')
|
|
654
|
+
|
|
655
|
+
klass.define_instance_method('_validators=')
|
|
656
|
+
|
|
657
|
+
klass.define_instance_method('_validators?')
|
|
658
|
+
|
|
659
|
+
klass.define_instance_method('attribute_aliases')
|
|
660
|
+
|
|
661
|
+
klass.define_instance_method('attribute_aliases?')
|
|
662
|
+
|
|
663
|
+
klass.define_instance_method('attribute_method_matchers')
|
|
664
|
+
|
|
665
|
+
klass.define_instance_method('attribute_method_matchers?')
|
|
666
|
+
|
|
667
|
+
klass.define_instance_method('attribute_types_cached_by_default')
|
|
668
|
+
|
|
669
|
+
klass.define_instance_method('attribute_types_cached_by_default?')
|
|
670
|
+
|
|
671
|
+
klass.define_instance_method('cache_timestamp_format')
|
|
672
|
+
|
|
673
|
+
klass.define_instance_method('cache_timestamp_format?')
|
|
674
|
+
|
|
675
|
+
klass.define_instance_method('configurations')
|
|
676
|
+
|
|
677
|
+
klass.define_instance_method('default_connection_handler')
|
|
678
|
+
|
|
679
|
+
klass.define_instance_method('default_connection_handler?')
|
|
680
|
+
|
|
681
|
+
klass.define_instance_method('default_scopes')
|
|
682
|
+
|
|
683
|
+
klass.define_instance_method('default_timezone')
|
|
684
|
+
|
|
685
|
+
klass.define_instance_method('disable_implicit_join_references')
|
|
686
|
+
|
|
687
|
+
klass.define_instance_method('include_root_in_json')
|
|
688
|
+
|
|
689
|
+
klass.define_instance_method('include_root_in_json=')
|
|
690
|
+
|
|
691
|
+
klass.define_instance_method('include_root_in_json?')
|
|
692
|
+
|
|
693
|
+
klass.define_instance_method('lock_optimistically')
|
|
694
|
+
|
|
695
|
+
klass.define_instance_method('lock_optimistically?')
|
|
696
|
+
|
|
697
|
+
klass.define_instance_method('logger')
|
|
698
|
+
|
|
699
|
+
klass.define_instance_method('nested_attributes_options')
|
|
700
|
+
|
|
701
|
+
klass.define_instance_method('nested_attributes_options?')
|
|
702
|
+
|
|
703
|
+
klass.define_instance_method('partial_writes')
|
|
704
|
+
|
|
705
|
+
klass.define_instance_method('partial_writes?')
|
|
706
|
+
|
|
707
|
+
klass.define_instance_method('pluralize_table_names')
|
|
708
|
+
|
|
709
|
+
klass.define_instance_method('pluralize_table_names?')
|
|
710
|
+
|
|
711
|
+
klass.define_instance_method('primary_key_prefix_type')
|
|
712
|
+
|
|
713
|
+
klass.define_instance_method('record_timestamps')
|
|
714
|
+
|
|
715
|
+
klass.define_instance_method('record_timestamps=')
|
|
716
|
+
|
|
717
|
+
klass.define_instance_method('record_timestamps?')
|
|
718
|
+
|
|
719
|
+
klass.define_instance_method('reflections')
|
|
720
|
+
|
|
721
|
+
klass.define_instance_method('reflections=')
|
|
722
|
+
|
|
723
|
+
klass.define_instance_method('reflections?')
|
|
724
|
+
|
|
725
|
+
klass.define_instance_method('schema_format')
|
|
726
|
+
|
|
727
|
+
klass.define_instance_method('skip_time_zone_conversion_for_attributes')
|
|
728
|
+
|
|
729
|
+
klass.define_instance_method('skip_time_zone_conversion_for_attributes?')
|
|
730
|
+
|
|
731
|
+
klass.define_instance_method('store_full_sti_class')
|
|
732
|
+
|
|
733
|
+
klass.define_instance_method('store_full_sti_class?')
|
|
734
|
+
|
|
735
|
+
klass.define_instance_method('table_name_prefix')
|
|
736
|
+
|
|
737
|
+
klass.define_instance_method('table_name_prefix?')
|
|
738
|
+
|
|
739
|
+
klass.define_instance_method('table_name_suffix')
|
|
740
|
+
|
|
741
|
+
klass.define_instance_method('table_name_suffix?')
|
|
742
|
+
|
|
743
|
+
klass.define_instance_method('time_zone_aware_attributes')
|
|
744
|
+
|
|
745
|
+
klass.define_instance_method('timestamped_migrations')
|
|
746
|
+
|
|
747
|
+
klass.define_instance_method('validation_context')
|
|
748
|
+
|
|
749
|
+
klass.define_instance_method('validation_context=')
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Batches') do |klass|
|
|
753
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
754
|
+
|
|
755
|
+
klass.define_instance_method('find_each') do |method|
|
|
756
|
+
method.define_optional_argument('options')
|
|
757
|
+
end
|
|
758
|
+
|
|
759
|
+
klass.define_instance_method('find_in_batches') do |method|
|
|
760
|
+
method.define_optional_argument('options')
|
|
761
|
+
end
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Calculations') do |klass|
|
|
765
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
766
|
+
|
|
767
|
+
klass.define_instance_method('average') do |method|
|
|
768
|
+
method.define_argument('column_name')
|
|
769
|
+
method.define_optional_argument('options')
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
klass.define_instance_method('calculate') do |method|
|
|
773
|
+
method.define_argument('operation')
|
|
774
|
+
method.define_argument('column_name')
|
|
775
|
+
method.define_optional_argument('options')
|
|
776
|
+
end
|
|
777
|
+
|
|
778
|
+
klass.define_instance_method('count') do |method|
|
|
779
|
+
method.define_optional_argument('column_name')
|
|
780
|
+
method.define_optional_argument('options')
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
klass.define_instance_method('ids')
|
|
784
|
+
|
|
785
|
+
klass.define_instance_method('maximum') do |method|
|
|
786
|
+
method.define_argument('column_name')
|
|
787
|
+
method.define_optional_argument('options')
|
|
788
|
+
end
|
|
789
|
+
|
|
790
|
+
klass.define_instance_method('minimum') do |method|
|
|
791
|
+
method.define_argument('column_name')
|
|
792
|
+
method.define_optional_argument('options')
|
|
793
|
+
end
|
|
794
|
+
|
|
795
|
+
klass.define_instance_method('pluck') do |method|
|
|
796
|
+
method.define_rest_argument('column_names')
|
|
797
|
+
end
|
|
798
|
+
|
|
799
|
+
klass.define_instance_method('sum') do |method|
|
|
800
|
+
method.define_rest_argument('args')
|
|
801
|
+
end
|
|
802
|
+
end
|
|
803
|
+
|
|
804
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Callbacks') do |klass|
|
|
805
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
806
|
+
|
|
807
|
+
klass.define_instance_method('destroy')
|
|
808
|
+
|
|
809
|
+
klass.define_instance_method('touch') do |method|
|
|
810
|
+
method.define_rest_argument('')
|
|
811
|
+
end
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Coders') do |klass|
|
|
815
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
816
|
+
end
|
|
817
|
+
|
|
818
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ConfigurationError') do |klass|
|
|
819
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ConnectionAdapters') do |klass|
|
|
823
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
824
|
+
end
|
|
825
|
+
|
|
826
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ConnectionHandling') do |klass|
|
|
827
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
828
|
+
|
|
829
|
+
klass.define_instance_method('clear_active_connections!') do |method|
|
|
830
|
+
method.define_rest_argument('args')
|
|
831
|
+
method.define_block_argument('block')
|
|
832
|
+
end
|
|
833
|
+
|
|
834
|
+
klass.define_instance_method('clear_all_connections!') do |method|
|
|
835
|
+
method.define_rest_argument('args')
|
|
836
|
+
method.define_block_argument('block')
|
|
837
|
+
end
|
|
838
|
+
|
|
839
|
+
klass.define_instance_method('clear_cache!')
|
|
840
|
+
|
|
841
|
+
klass.define_instance_method('clear_reloadable_connections!') do |method|
|
|
842
|
+
method.define_rest_argument('args')
|
|
843
|
+
method.define_block_argument('block')
|
|
844
|
+
end
|
|
845
|
+
|
|
846
|
+
klass.define_instance_method('connected?')
|
|
847
|
+
|
|
848
|
+
klass.define_instance_method('connection')
|
|
849
|
+
|
|
850
|
+
klass.define_instance_method('connection_config')
|
|
851
|
+
|
|
852
|
+
klass.define_instance_method('connection_id')
|
|
853
|
+
|
|
854
|
+
klass.define_instance_method('connection_id=') do |method|
|
|
855
|
+
method.define_argument('connection_id')
|
|
856
|
+
end
|
|
857
|
+
|
|
858
|
+
klass.define_instance_method('connection_pool')
|
|
859
|
+
|
|
860
|
+
klass.define_instance_method('establish_connection') do |method|
|
|
861
|
+
method.define_optional_argument('spec')
|
|
862
|
+
end
|
|
863
|
+
|
|
864
|
+
klass.define_instance_method('remove_connection') do |method|
|
|
865
|
+
method.define_optional_argument('klass')
|
|
866
|
+
end
|
|
867
|
+
|
|
868
|
+
klass.define_instance_method('retrieve_connection')
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ConnectionNotEstablished') do |klass|
|
|
872
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
873
|
+
end
|
|
874
|
+
|
|
875
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ConnectionTimeoutError') do |klass|
|
|
876
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ConnectionNotEstablished'))
|
|
877
|
+
end
|
|
878
|
+
|
|
879
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Core') do |klass|
|
|
880
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
881
|
+
|
|
882
|
+
klass.define_instance_method('<=>') do |method|
|
|
883
|
+
method.define_argument('other_object')
|
|
884
|
+
end
|
|
885
|
+
|
|
886
|
+
klass.define_instance_method('==') do |method|
|
|
887
|
+
method.define_argument('comparison_object')
|
|
888
|
+
end
|
|
889
|
+
|
|
890
|
+
klass.define_instance_method('connection')
|
|
891
|
+
|
|
892
|
+
klass.define_instance_method('connection_handler')
|
|
893
|
+
|
|
894
|
+
klass.define_instance_method('encode_with') do |method|
|
|
895
|
+
method.define_argument('coder')
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
klass.define_instance_method('eql?') do |method|
|
|
899
|
+
method.define_argument('comparison_object')
|
|
900
|
+
end
|
|
901
|
+
|
|
902
|
+
klass.define_instance_method('freeze')
|
|
903
|
+
|
|
904
|
+
klass.define_instance_method('frozen?')
|
|
905
|
+
|
|
906
|
+
klass.define_instance_method('has_transactional_callbacks?')
|
|
907
|
+
|
|
908
|
+
klass.define_instance_method('hash')
|
|
909
|
+
|
|
910
|
+
klass.define_instance_method('init_with') do |method|
|
|
911
|
+
method.define_argument('coder')
|
|
912
|
+
end
|
|
913
|
+
|
|
914
|
+
klass.define_instance_method('initialize_dup') do |method|
|
|
915
|
+
method.define_argument('other')
|
|
916
|
+
end
|
|
917
|
+
|
|
918
|
+
klass.define_instance_method('inspect')
|
|
919
|
+
|
|
920
|
+
klass.define_instance_method('readonly!')
|
|
921
|
+
|
|
922
|
+
klass.define_instance_method('readonly?')
|
|
923
|
+
|
|
924
|
+
klass.define_instance_method('set_transaction_state') do |method|
|
|
925
|
+
method.define_argument('state')
|
|
926
|
+
end
|
|
927
|
+
|
|
928
|
+
klass.define_instance_method('slice') do |method|
|
|
929
|
+
method.define_rest_argument('methods')
|
|
930
|
+
end
|
|
931
|
+
end
|
|
932
|
+
|
|
933
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::CounterCache') do |klass|
|
|
934
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::DangerousAttributeError') do |klass|
|
|
938
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
939
|
+
end
|
|
940
|
+
|
|
941
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Delegation') do |klass|
|
|
942
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
943
|
+
|
|
944
|
+
klass.define_instance_method('all?') do |method|
|
|
945
|
+
method.define_rest_argument('args')
|
|
946
|
+
method.define_block_argument('block')
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
klass.define_instance_method('collect') do |method|
|
|
950
|
+
method.define_rest_argument('args')
|
|
951
|
+
method.define_block_argument('block')
|
|
952
|
+
end
|
|
953
|
+
|
|
954
|
+
klass.define_instance_method('columns_hash') do |method|
|
|
955
|
+
method.define_rest_argument('args')
|
|
956
|
+
method.define_block_argument('block')
|
|
957
|
+
end
|
|
958
|
+
|
|
959
|
+
klass.define_instance_method('connection') do |method|
|
|
960
|
+
method.define_rest_argument('args')
|
|
961
|
+
method.define_block_argument('block')
|
|
962
|
+
end
|
|
963
|
+
|
|
964
|
+
klass.define_instance_method('each') do |method|
|
|
965
|
+
method.define_rest_argument('args')
|
|
966
|
+
method.define_block_argument('block')
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
klass.define_instance_method('include?') do |method|
|
|
970
|
+
method.define_rest_argument('args')
|
|
971
|
+
method.define_block_argument('block')
|
|
972
|
+
end
|
|
973
|
+
|
|
974
|
+
klass.define_instance_method('length') do |method|
|
|
975
|
+
method.define_rest_argument('args')
|
|
976
|
+
method.define_block_argument('block')
|
|
977
|
+
end
|
|
978
|
+
|
|
979
|
+
klass.define_instance_method('map') do |method|
|
|
980
|
+
method.define_rest_argument('args')
|
|
981
|
+
method.define_block_argument('block')
|
|
982
|
+
end
|
|
983
|
+
|
|
984
|
+
klass.define_instance_method('method_missing') do |method|
|
|
985
|
+
method.define_argument('method')
|
|
986
|
+
method.define_rest_argument('args')
|
|
987
|
+
method.define_block_argument('block')
|
|
988
|
+
end
|
|
989
|
+
|
|
990
|
+
klass.define_instance_method('primary_key') do |method|
|
|
991
|
+
method.define_rest_argument('args')
|
|
992
|
+
method.define_block_argument('block')
|
|
993
|
+
end
|
|
994
|
+
|
|
995
|
+
klass.define_instance_method('quoted_primary_key') do |method|
|
|
996
|
+
method.define_rest_argument('args')
|
|
997
|
+
method.define_block_argument('block')
|
|
998
|
+
end
|
|
999
|
+
|
|
1000
|
+
klass.define_instance_method('quoted_table_name') do |method|
|
|
1001
|
+
method.define_rest_argument('args')
|
|
1002
|
+
method.define_block_argument('block')
|
|
1003
|
+
end
|
|
1004
|
+
|
|
1005
|
+
klass.define_instance_method('respond_to?') do |method|
|
|
1006
|
+
method.define_argument('method')
|
|
1007
|
+
method.define_optional_argument('include_private')
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
klass.define_instance_method('table_name') do |method|
|
|
1011
|
+
method.define_rest_argument('args')
|
|
1012
|
+
method.define_block_argument('block')
|
|
1013
|
+
end
|
|
1014
|
+
|
|
1015
|
+
klass.define_instance_method('to_ary') do |method|
|
|
1016
|
+
method.define_rest_argument('args')
|
|
1017
|
+
method.define_block_argument('block')
|
|
1018
|
+
end
|
|
1019
|
+
|
|
1020
|
+
klass.define_instance_method('to_xml') do |method|
|
|
1021
|
+
method.define_rest_argument('args')
|
|
1022
|
+
method.define_block_argument('block')
|
|
1023
|
+
end
|
|
1024
|
+
|
|
1025
|
+
klass.define_instance_method('to_yaml') do |method|
|
|
1026
|
+
method.define_rest_argument('args')
|
|
1027
|
+
method.define_block_argument('block')
|
|
1028
|
+
end
|
|
1029
|
+
end
|
|
1030
|
+
|
|
1031
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::DeleteRestrictionError') do |klass|
|
|
1032
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1033
|
+
end
|
|
1034
|
+
|
|
1035
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::DeprecatedFinders') do |klass|
|
|
1036
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1037
|
+
|
|
1038
|
+
klass.define_instance_method('all') do |method|
|
|
1039
|
+
method.define_optional_argument('options')
|
|
1040
|
+
end
|
|
1041
|
+
|
|
1042
|
+
klass.define_instance_method('default_scope') do |method|
|
|
1043
|
+
method.define_optional_argument('scope')
|
|
1044
|
+
method.define_block_argument('block')
|
|
1045
|
+
end
|
|
1046
|
+
|
|
1047
|
+
klass.define_instance_method('scope') do |method|
|
|
1048
|
+
method.define_argument('name')
|
|
1049
|
+
method.define_optional_argument('body')
|
|
1050
|
+
method.define_block_argument('block')
|
|
1051
|
+
end
|
|
1052
|
+
|
|
1053
|
+
klass.define_instance_method('scoped') do |method|
|
|
1054
|
+
method.define_optional_argument('options')
|
|
1055
|
+
end
|
|
1056
|
+
|
|
1057
|
+
klass.define_instance_method('with_exclusive_scope') do |method|
|
|
1058
|
+
method.define_optional_argument('method_scoping')
|
|
1059
|
+
method.define_block_argument('block')
|
|
1060
|
+
end
|
|
1061
|
+
|
|
1062
|
+
klass.define_instance_method('with_scope') do |method|
|
|
1063
|
+
method.define_optional_argument('scope')
|
|
1064
|
+
method.define_optional_argument('action')
|
|
1065
|
+
end
|
|
1066
|
+
end
|
|
1067
|
+
|
|
1068
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::DuplicateMigrationNameError') do |klass|
|
|
1069
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1070
|
+
end
|
|
1071
|
+
|
|
1072
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::DuplicateMigrationVersionError') do |klass|
|
|
1073
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1074
|
+
end
|
|
1075
|
+
|
|
1076
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::DynamicMatchers') do |klass|
|
|
1077
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1078
|
+
|
|
1079
|
+
klass.define_instance_method('respond_to?') do |method|
|
|
1080
|
+
method.define_argument('name')
|
|
1081
|
+
method.define_optional_argument('include_private')
|
|
1082
|
+
end
|
|
1083
|
+
end
|
|
1084
|
+
|
|
1085
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::EagerLoadPolymorphicError') do |klass|
|
|
1086
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1087
|
+
end
|
|
1088
|
+
|
|
1089
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Explain') do |klass|
|
|
1090
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1091
|
+
|
|
1092
|
+
klass.define_instance_method('collecting_queries_for_explain')
|
|
1093
|
+
|
|
1094
|
+
klass.define_instance_method('exec_explain') do |method|
|
|
1095
|
+
method.define_argument('queries')
|
|
1096
|
+
end
|
|
1097
|
+
end
|
|
1098
|
+
|
|
1099
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ExplainRegistry') do |klass|
|
|
1100
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1101
|
+
|
|
1102
|
+
klass.define_instance_method('collect')
|
|
1103
|
+
|
|
1104
|
+
klass.define_instance_method('collect=')
|
|
1105
|
+
|
|
1106
|
+
klass.define_instance_method('collect?')
|
|
1107
|
+
|
|
1108
|
+
klass.define_instance_method('queries')
|
|
1109
|
+
|
|
1110
|
+
klass.define_instance_method('queries=')
|
|
1111
|
+
|
|
1112
|
+
klass.define_instance_method('reset')
|
|
1113
|
+
end
|
|
1114
|
+
|
|
1115
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::FinderMethods') do |klass|
|
|
1116
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1117
|
+
|
|
1118
|
+
klass.define_instance_method('apply_join_dependency') do |method|
|
|
1119
|
+
method.define_argument('relation')
|
|
1120
|
+
method.define_argument('join_dependency')
|
|
1121
|
+
end
|
|
1122
|
+
|
|
1123
|
+
klass.define_instance_method('construct_join_dependency_for_association_find')
|
|
1124
|
+
|
|
1125
|
+
klass.define_instance_method('construct_limited_ids_condition') do |method|
|
|
1126
|
+
method.define_argument('relation')
|
|
1127
|
+
end
|
|
1128
|
+
|
|
1129
|
+
klass.define_instance_method('construct_relation_for_association_calculations')
|
|
1130
|
+
|
|
1131
|
+
klass.define_instance_method('construct_relation_for_association_find') do |method|
|
|
1132
|
+
method.define_argument('join_dependency')
|
|
1133
|
+
end
|
|
1134
|
+
|
|
1135
|
+
klass.define_instance_method('exists?') do |method|
|
|
1136
|
+
method.define_optional_argument('conditions')
|
|
1137
|
+
end
|
|
1138
|
+
|
|
1139
|
+
klass.define_instance_method('find') do |method|
|
|
1140
|
+
method.define_rest_argument('args')
|
|
1141
|
+
end
|
|
1142
|
+
|
|
1143
|
+
klass.define_instance_method('find_by') do |method|
|
|
1144
|
+
method.define_rest_argument('args')
|
|
1145
|
+
end
|
|
1146
|
+
|
|
1147
|
+
klass.define_instance_method('find_by!') do |method|
|
|
1148
|
+
method.define_rest_argument('args')
|
|
1149
|
+
end
|
|
1150
|
+
|
|
1151
|
+
klass.define_instance_method('find_first')
|
|
1152
|
+
|
|
1153
|
+
klass.define_instance_method('find_last')
|
|
1154
|
+
|
|
1155
|
+
klass.define_instance_method('find_one') do |method|
|
|
1156
|
+
method.define_argument('id')
|
|
1157
|
+
end
|
|
1158
|
+
|
|
1159
|
+
klass.define_instance_method('find_some') do |method|
|
|
1160
|
+
method.define_argument('ids')
|
|
1161
|
+
end
|
|
1162
|
+
|
|
1163
|
+
klass.define_instance_method('find_take')
|
|
1164
|
+
|
|
1165
|
+
klass.define_instance_method('find_with_associations')
|
|
1166
|
+
|
|
1167
|
+
klass.define_instance_method('find_with_ids') do |method|
|
|
1168
|
+
method.define_rest_argument('ids')
|
|
1169
|
+
end
|
|
1170
|
+
|
|
1171
|
+
klass.define_instance_method('first') do |method|
|
|
1172
|
+
method.define_optional_argument('limit')
|
|
1173
|
+
end
|
|
1174
|
+
|
|
1175
|
+
klass.define_instance_method('first!')
|
|
1176
|
+
|
|
1177
|
+
klass.define_instance_method('last') do |method|
|
|
1178
|
+
method.define_optional_argument('limit')
|
|
1179
|
+
end
|
|
1180
|
+
|
|
1181
|
+
klass.define_instance_method('last!')
|
|
1182
|
+
|
|
1183
|
+
klass.define_instance_method('raise_record_not_found_exception!') do |method|
|
|
1184
|
+
method.define_argument('ids')
|
|
1185
|
+
method.define_argument('result_size')
|
|
1186
|
+
method.define_argument('expected_size')
|
|
1187
|
+
end
|
|
1188
|
+
|
|
1189
|
+
klass.define_instance_method('take') do |method|
|
|
1190
|
+
method.define_optional_argument('limit')
|
|
1191
|
+
end
|
|
1192
|
+
|
|
1193
|
+
klass.define_instance_method('take!')
|
|
1194
|
+
|
|
1195
|
+
klass.define_instance_method('using_limitable_reflections?') do |method|
|
|
1196
|
+
method.define_argument('reflections')
|
|
1197
|
+
end
|
|
1198
|
+
end
|
|
1199
|
+
|
|
1200
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasAndBelongsToManyAssociationForeignKeyNeeded') do |klass|
|
|
1201
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1202
|
+
end
|
|
1203
|
+
|
|
1204
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughAssociationNotFoundError') do |klass|
|
|
1205
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1206
|
+
end
|
|
1207
|
+
|
|
1208
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughAssociationPointlessSourceTypeError') do |klass|
|
|
1209
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1210
|
+
end
|
|
1211
|
+
|
|
1212
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughAssociationPolymorphicSourceError') do |klass|
|
|
1213
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1214
|
+
end
|
|
1215
|
+
|
|
1216
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughAssociationPolymorphicThroughError') do |klass|
|
|
1217
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1218
|
+
end
|
|
1219
|
+
|
|
1220
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughCantAssociateNewRecords') do |klass|
|
|
1221
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1222
|
+
end
|
|
1223
|
+
|
|
1224
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection') do |klass|
|
|
1225
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1226
|
+
end
|
|
1227
|
+
|
|
1228
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughCantDissociateNewRecords') do |klass|
|
|
1229
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1230
|
+
end
|
|
1231
|
+
|
|
1232
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughNestedAssociationsAreReadonly') do |klass|
|
|
1233
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1234
|
+
end
|
|
1235
|
+
|
|
1236
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasManyThroughSourceAssociationNotFoundError') do |klass|
|
|
1237
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1238
|
+
end
|
|
1239
|
+
|
|
1240
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::HasOneThroughCantAssociateThroughCollection') do |klass|
|
|
1241
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1242
|
+
end
|
|
1243
|
+
|
|
1244
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::IllegalMigrationNameError') do |klass|
|
|
1245
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1246
|
+
end
|
|
1247
|
+
|
|
1248
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ImmutableRelation') do |klass|
|
|
1249
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1250
|
+
end
|
|
1251
|
+
|
|
1252
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Inheritance') do |klass|
|
|
1253
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1254
|
+
end
|
|
1255
|
+
|
|
1256
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Integration') do |klass|
|
|
1257
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1258
|
+
|
|
1259
|
+
klass.define_instance_method('cache_key')
|
|
1260
|
+
|
|
1261
|
+
klass.define_instance_method('to_param')
|
|
1262
|
+
end
|
|
1263
|
+
|
|
1264
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::InvalidForeignKey') do |klass|
|
|
1265
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::WrappedDatabaseException'))
|
|
1266
|
+
end
|
|
1267
|
+
|
|
1268
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::InverseOfAssociationNotFoundError') do |klass|
|
|
1269
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1270
|
+
end
|
|
1271
|
+
|
|
1272
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::IrreversibleMigration') do |klass|
|
|
1273
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1274
|
+
end
|
|
1275
|
+
|
|
1276
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Locking') do |klass|
|
|
1277
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1278
|
+
end
|
|
1279
|
+
|
|
1280
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Migration') do |klass|
|
|
1281
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1282
|
+
|
|
1283
|
+
klass.define_method('check_pending!')
|
|
1284
|
+
|
|
1285
|
+
klass.define_method('delegate')
|
|
1286
|
+
|
|
1287
|
+
klass.define_method('delegate=')
|
|
1288
|
+
|
|
1289
|
+
klass.define_method('disable_ddl_transaction')
|
|
1290
|
+
|
|
1291
|
+
klass.define_method('disable_ddl_transaction!')
|
|
1292
|
+
|
|
1293
|
+
klass.define_method('disable_ddl_transaction=')
|
|
1294
|
+
|
|
1295
|
+
klass.define_method('method_missing') do |method|
|
|
1296
|
+
method.define_argument('name')
|
|
1297
|
+
method.define_rest_argument('args')
|
|
1298
|
+
method.define_block_argument('block')
|
|
1299
|
+
end
|
|
1300
|
+
|
|
1301
|
+
klass.define_method('migrate') do |method|
|
|
1302
|
+
method.define_argument('direction')
|
|
1303
|
+
end
|
|
1304
|
+
|
|
1305
|
+
klass.define_method('verbose')
|
|
1306
|
+
|
|
1307
|
+
klass.define_method('verbose=') do |method|
|
|
1308
|
+
method.define_argument('obj')
|
|
1309
|
+
end
|
|
1310
|
+
|
|
1311
|
+
klass.define_instance_method('announce') do |method|
|
|
1312
|
+
method.define_argument('message')
|
|
1313
|
+
end
|
|
1314
|
+
|
|
1315
|
+
klass.define_instance_method('connection')
|
|
1316
|
+
|
|
1317
|
+
klass.define_instance_method('copy') do |method|
|
|
1318
|
+
method.define_argument('destination')
|
|
1319
|
+
method.define_argument('sources')
|
|
1320
|
+
method.define_optional_argument('options')
|
|
1321
|
+
end
|
|
1322
|
+
|
|
1323
|
+
klass.define_instance_method('disable_ddl_transaction')
|
|
1324
|
+
|
|
1325
|
+
klass.define_instance_method('down')
|
|
1326
|
+
|
|
1327
|
+
klass.define_instance_method('exec_migration') do |method|
|
|
1328
|
+
method.define_argument('conn')
|
|
1329
|
+
method.define_argument('direction')
|
|
1330
|
+
end
|
|
1331
|
+
|
|
1332
|
+
klass.define_instance_method('method_missing') do |method|
|
|
1333
|
+
method.define_argument('method')
|
|
1334
|
+
method.define_rest_argument('arguments')
|
|
1335
|
+
method.define_block_argument('block')
|
|
1336
|
+
end
|
|
1337
|
+
|
|
1338
|
+
klass.define_instance_method('migrate') do |method|
|
|
1339
|
+
method.define_argument('direction')
|
|
1340
|
+
end
|
|
1341
|
+
|
|
1342
|
+
klass.define_instance_method('name')
|
|
1343
|
+
|
|
1344
|
+
klass.define_instance_method('name=')
|
|
1345
|
+
|
|
1346
|
+
klass.define_instance_method('next_migration_number') do |method|
|
|
1347
|
+
method.define_argument('number')
|
|
1348
|
+
end
|
|
1349
|
+
|
|
1350
|
+
klass.define_instance_method('reversible')
|
|
1351
|
+
|
|
1352
|
+
klass.define_instance_method('revert') do |method|
|
|
1353
|
+
method.define_rest_argument('migration_classes')
|
|
1354
|
+
end
|
|
1355
|
+
|
|
1356
|
+
klass.define_instance_method('reverting?')
|
|
1357
|
+
|
|
1358
|
+
klass.define_instance_method('run') do |method|
|
|
1359
|
+
method.define_rest_argument('migration_classes')
|
|
1360
|
+
end
|
|
1361
|
+
|
|
1362
|
+
klass.define_instance_method('say') do |method|
|
|
1363
|
+
method.define_argument('message')
|
|
1364
|
+
method.define_optional_argument('subitem')
|
|
1365
|
+
end
|
|
1366
|
+
|
|
1367
|
+
klass.define_instance_method('say_with_time') do |method|
|
|
1368
|
+
method.define_argument('message')
|
|
1369
|
+
end
|
|
1370
|
+
|
|
1371
|
+
klass.define_instance_method('suppress_messages')
|
|
1372
|
+
|
|
1373
|
+
klass.define_instance_method('up')
|
|
1374
|
+
|
|
1375
|
+
klass.define_instance_method('verbose')
|
|
1376
|
+
|
|
1377
|
+
klass.define_instance_method('verbose=') do |method|
|
|
1378
|
+
method.define_argument('obj')
|
|
1379
|
+
end
|
|
1380
|
+
|
|
1381
|
+
klass.define_instance_method('version')
|
|
1382
|
+
|
|
1383
|
+
klass.define_instance_method('version=')
|
|
1384
|
+
|
|
1385
|
+
klass.define_instance_method('write') do |method|
|
|
1386
|
+
method.define_optional_argument('text')
|
|
1387
|
+
end
|
|
1388
|
+
end
|
|
1389
|
+
|
|
1390
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::MigrationProxy') do |klass|
|
|
1391
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('#<Class:0x17a7c>'))
|
|
1392
|
+
|
|
1393
|
+
klass.define_instance_method('announce') do |method|
|
|
1394
|
+
method.define_rest_argument('args')
|
|
1395
|
+
method.define_block_argument('block')
|
|
1396
|
+
end
|
|
1397
|
+
|
|
1398
|
+
klass.define_instance_method('basename')
|
|
1399
|
+
|
|
1400
|
+
klass.define_instance_method('disable_ddl_transaction') do |method|
|
|
1401
|
+
method.define_rest_argument('args')
|
|
1402
|
+
method.define_block_argument('block')
|
|
1403
|
+
end
|
|
1404
|
+
|
|
1405
|
+
klass.define_instance_method('migrate') do |method|
|
|
1406
|
+
method.define_rest_argument('args')
|
|
1407
|
+
method.define_block_argument('block')
|
|
1408
|
+
end
|
|
1409
|
+
|
|
1410
|
+
klass.define_instance_method('mtime')
|
|
1411
|
+
|
|
1412
|
+
klass.define_instance_method('write') do |method|
|
|
1413
|
+
method.define_rest_argument('args')
|
|
1414
|
+
method.define_block_argument('block')
|
|
1415
|
+
end
|
|
1416
|
+
end
|
|
1417
|
+
|
|
1418
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Migrator') do |klass|
|
|
1419
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1420
|
+
|
|
1421
|
+
klass.define_method('current_version')
|
|
1422
|
+
|
|
1423
|
+
klass.define_method('down') do |method|
|
|
1424
|
+
method.define_argument('migrations_paths')
|
|
1425
|
+
method.define_optional_argument('target_version')
|
|
1426
|
+
method.define_block_argument('block')
|
|
1427
|
+
end
|
|
1428
|
+
|
|
1429
|
+
klass.define_method('forward') do |method|
|
|
1430
|
+
method.define_argument('migrations_paths')
|
|
1431
|
+
method.define_optional_argument('steps')
|
|
1432
|
+
end
|
|
1433
|
+
|
|
1434
|
+
klass.define_method('get_all_versions')
|
|
1435
|
+
|
|
1436
|
+
klass.define_method('last_migration')
|
|
1437
|
+
|
|
1438
|
+
klass.define_method('last_version')
|
|
1439
|
+
|
|
1440
|
+
klass.define_method('migrate') do |method|
|
|
1441
|
+
method.define_argument('migrations_paths')
|
|
1442
|
+
method.define_optional_argument('target_version')
|
|
1443
|
+
method.define_block_argument('block')
|
|
1444
|
+
end
|
|
1445
|
+
|
|
1446
|
+
klass.define_method('migrations') do |method|
|
|
1447
|
+
method.define_argument('paths')
|
|
1448
|
+
end
|
|
1449
|
+
|
|
1450
|
+
klass.define_method('migrations_path')
|
|
1451
|
+
|
|
1452
|
+
klass.define_method('migrations_path=')
|
|
1453
|
+
|
|
1454
|
+
klass.define_method('migrations_paths')
|
|
1455
|
+
|
|
1456
|
+
klass.define_method('migrations_paths=')
|
|
1457
|
+
|
|
1458
|
+
klass.define_method('needs_migration?')
|
|
1459
|
+
|
|
1460
|
+
klass.define_method('open') do |method|
|
|
1461
|
+
method.define_argument('migrations_paths')
|
|
1462
|
+
end
|
|
1463
|
+
|
|
1464
|
+
klass.define_method('proper_table_name') do |method|
|
|
1465
|
+
method.define_argument('name')
|
|
1466
|
+
end
|
|
1467
|
+
|
|
1468
|
+
klass.define_method('rollback') do |method|
|
|
1469
|
+
method.define_argument('migrations_paths')
|
|
1470
|
+
method.define_optional_argument('steps')
|
|
1471
|
+
end
|
|
1472
|
+
|
|
1473
|
+
klass.define_method('run') do |method|
|
|
1474
|
+
method.define_argument('direction')
|
|
1475
|
+
method.define_argument('migrations_paths')
|
|
1476
|
+
method.define_argument('target_version')
|
|
1477
|
+
end
|
|
1478
|
+
|
|
1479
|
+
klass.define_method('schema_migrations_table_name')
|
|
1480
|
+
|
|
1481
|
+
klass.define_method('up') do |method|
|
|
1482
|
+
method.define_argument('migrations_paths')
|
|
1483
|
+
method.define_optional_argument('target_version')
|
|
1484
|
+
end
|
|
1485
|
+
|
|
1486
|
+
klass.define_instance_method('current')
|
|
1487
|
+
|
|
1488
|
+
klass.define_instance_method('current_migration')
|
|
1489
|
+
|
|
1490
|
+
klass.define_instance_method('current_version')
|
|
1491
|
+
|
|
1492
|
+
klass.define_instance_method('migrate')
|
|
1493
|
+
|
|
1494
|
+
klass.define_instance_method('migrated')
|
|
1495
|
+
|
|
1496
|
+
klass.define_instance_method('migrations')
|
|
1497
|
+
|
|
1498
|
+
klass.define_instance_method('pending_migrations')
|
|
1499
|
+
|
|
1500
|
+
klass.define_instance_method('run')
|
|
1501
|
+
|
|
1502
|
+
klass.define_instance_method('runnable')
|
|
1503
|
+
end
|
|
1504
|
+
|
|
1505
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ModelSchema') do |klass|
|
|
1506
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1507
|
+
end
|
|
1508
|
+
|
|
1509
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::MultiparameterAssignmentErrors') do |klass|
|
|
1510
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1511
|
+
|
|
1512
|
+
klass.define_instance_method('errors')
|
|
1513
|
+
end
|
|
1514
|
+
|
|
1515
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::NestedAttributes') do |klass|
|
|
1516
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1517
|
+
|
|
1518
|
+
klass.define_instance_method('_destroy')
|
|
1519
|
+
end
|
|
1520
|
+
|
|
1521
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::NullMigration') do |klass|
|
|
1522
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::MigrationProxy'))
|
|
1523
|
+
|
|
1524
|
+
klass.define_instance_method('mtime')
|
|
1525
|
+
end
|
|
1526
|
+
|
|
1527
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::NullRelation') do |klass|
|
|
1528
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1529
|
+
|
|
1530
|
+
klass.define_instance_method('any?')
|
|
1531
|
+
|
|
1532
|
+
klass.define_instance_method('calculate') do |method|
|
|
1533
|
+
method.define_argument('_operation')
|
|
1534
|
+
method.define_argument('_column_name')
|
|
1535
|
+
method.define_optional_argument('_options')
|
|
1536
|
+
end
|
|
1537
|
+
|
|
1538
|
+
klass.define_instance_method('count') do |method|
|
|
1539
|
+
method.define_rest_argument('')
|
|
1540
|
+
end
|
|
1541
|
+
|
|
1542
|
+
klass.define_instance_method('delete') do |method|
|
|
1543
|
+
method.define_argument('_id_or_array')
|
|
1544
|
+
end
|
|
1545
|
+
|
|
1546
|
+
klass.define_instance_method('delete_all') do |method|
|
|
1547
|
+
method.define_optional_argument('_conditions')
|
|
1548
|
+
end
|
|
1549
|
+
|
|
1550
|
+
klass.define_instance_method('empty?')
|
|
1551
|
+
|
|
1552
|
+
klass.define_instance_method('exec_queries')
|
|
1553
|
+
|
|
1554
|
+
klass.define_instance_method('exists?') do |method|
|
|
1555
|
+
method.define_optional_argument('_id')
|
|
1556
|
+
end
|
|
1557
|
+
|
|
1558
|
+
klass.define_instance_method('many?')
|
|
1559
|
+
|
|
1560
|
+
klass.define_instance_method('pluck') do |method|
|
|
1561
|
+
method.define_argument('_column_name')
|
|
1562
|
+
end
|
|
1563
|
+
|
|
1564
|
+
klass.define_instance_method('size')
|
|
1565
|
+
|
|
1566
|
+
klass.define_instance_method('sum') do |method|
|
|
1567
|
+
method.define_rest_argument('')
|
|
1568
|
+
end
|
|
1569
|
+
|
|
1570
|
+
klass.define_instance_method('to_sql')
|
|
1571
|
+
|
|
1572
|
+
klass.define_instance_method('update_all') do |method|
|
|
1573
|
+
method.define_argument('_updates')
|
|
1574
|
+
method.define_optional_argument('_conditions')
|
|
1575
|
+
method.define_optional_argument('_options')
|
|
1576
|
+
end
|
|
1577
|
+
|
|
1578
|
+
klass.define_instance_method('where_values_hash')
|
|
1579
|
+
end
|
|
1580
|
+
|
|
1581
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::PendingMigrationError') do |klass|
|
|
1582
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1583
|
+
end
|
|
1584
|
+
|
|
1585
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Persistence') do |klass|
|
|
1586
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1587
|
+
|
|
1588
|
+
klass.define_instance_method('becomes') do |method|
|
|
1589
|
+
method.define_argument('klass')
|
|
1590
|
+
end
|
|
1591
|
+
|
|
1592
|
+
klass.define_instance_method('becomes!') do |method|
|
|
1593
|
+
method.define_argument('klass')
|
|
1594
|
+
end
|
|
1595
|
+
|
|
1596
|
+
klass.define_instance_method('decrement') do |method|
|
|
1597
|
+
method.define_argument('attribute')
|
|
1598
|
+
method.define_optional_argument('by')
|
|
1599
|
+
end
|
|
1600
|
+
|
|
1601
|
+
klass.define_instance_method('decrement!') do |method|
|
|
1602
|
+
method.define_argument('attribute')
|
|
1603
|
+
method.define_optional_argument('by')
|
|
1604
|
+
end
|
|
1605
|
+
|
|
1606
|
+
klass.define_instance_method('delete')
|
|
1607
|
+
|
|
1608
|
+
klass.define_instance_method('destroy')
|
|
1609
|
+
|
|
1610
|
+
klass.define_instance_method('destroy!')
|
|
1611
|
+
|
|
1612
|
+
klass.define_instance_method('destroyed?')
|
|
1613
|
+
|
|
1614
|
+
klass.define_instance_method('increment') do |method|
|
|
1615
|
+
method.define_argument('attribute')
|
|
1616
|
+
method.define_optional_argument('by')
|
|
1617
|
+
end
|
|
1618
|
+
|
|
1619
|
+
klass.define_instance_method('increment!') do |method|
|
|
1620
|
+
method.define_argument('attribute')
|
|
1621
|
+
method.define_optional_argument('by')
|
|
1622
|
+
end
|
|
1623
|
+
|
|
1624
|
+
klass.define_instance_method('new_record?')
|
|
1625
|
+
|
|
1626
|
+
klass.define_instance_method('persisted?')
|
|
1627
|
+
|
|
1628
|
+
klass.define_instance_method('reload') do |method|
|
|
1629
|
+
method.define_optional_argument('options')
|
|
1630
|
+
end
|
|
1631
|
+
|
|
1632
|
+
klass.define_instance_method('save') do |method|
|
|
1633
|
+
method.define_rest_argument('')
|
|
1634
|
+
end
|
|
1635
|
+
|
|
1636
|
+
klass.define_instance_method('save!') do |method|
|
|
1637
|
+
method.define_rest_argument('')
|
|
1638
|
+
end
|
|
1639
|
+
|
|
1640
|
+
klass.define_instance_method('toggle') do |method|
|
|
1641
|
+
method.define_argument('attribute')
|
|
1642
|
+
end
|
|
1643
|
+
|
|
1644
|
+
klass.define_instance_method('toggle!') do |method|
|
|
1645
|
+
method.define_argument('attribute')
|
|
1646
|
+
end
|
|
1647
|
+
|
|
1648
|
+
klass.define_instance_method('touch') do |method|
|
|
1649
|
+
method.define_optional_argument('name')
|
|
1650
|
+
end
|
|
1651
|
+
|
|
1652
|
+
klass.define_instance_method('update') do |method|
|
|
1653
|
+
method.define_argument('attributes')
|
|
1654
|
+
end
|
|
1655
|
+
|
|
1656
|
+
klass.define_instance_method('update!') do |method|
|
|
1657
|
+
method.define_argument('attributes')
|
|
1658
|
+
end
|
|
1659
|
+
|
|
1660
|
+
klass.define_instance_method('update_attribute') do |method|
|
|
1661
|
+
method.define_argument('name')
|
|
1662
|
+
method.define_argument('value')
|
|
1663
|
+
end
|
|
1664
|
+
|
|
1665
|
+
klass.define_instance_method('update_attributes') do |method|
|
|
1666
|
+
method.define_argument('attributes')
|
|
1667
|
+
end
|
|
1668
|
+
|
|
1669
|
+
klass.define_instance_method('update_attributes!') do |method|
|
|
1670
|
+
method.define_argument('attributes')
|
|
1671
|
+
end
|
|
1672
|
+
|
|
1673
|
+
klass.define_instance_method('update_column') do |method|
|
|
1674
|
+
method.define_argument('name')
|
|
1675
|
+
method.define_argument('value')
|
|
1676
|
+
end
|
|
1677
|
+
|
|
1678
|
+
klass.define_instance_method('update_columns') do |method|
|
|
1679
|
+
method.define_argument('attributes')
|
|
1680
|
+
end
|
|
1681
|
+
end
|
|
1682
|
+
|
|
1683
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::PredicateBuilder') do |klass|
|
|
1684
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1685
|
+
|
|
1686
|
+
klass.define_method('build') do |method|
|
|
1687
|
+
method.define_argument('attribute')
|
|
1688
|
+
method.define_argument('value')
|
|
1689
|
+
end
|
|
1690
|
+
|
|
1691
|
+
klass.define_method('build_from_hash') do |method|
|
|
1692
|
+
method.define_argument('klass')
|
|
1693
|
+
method.define_argument('attributes')
|
|
1694
|
+
method.define_argument('default_table')
|
|
1695
|
+
end
|
|
1696
|
+
|
|
1697
|
+
klass.define_method('expand') do |method|
|
|
1698
|
+
method.define_argument('klass')
|
|
1699
|
+
method.define_argument('table')
|
|
1700
|
+
method.define_argument('column')
|
|
1701
|
+
method.define_argument('value')
|
|
1702
|
+
end
|
|
1703
|
+
|
|
1704
|
+
klass.define_method('references') do |method|
|
|
1705
|
+
method.define_argument('attributes')
|
|
1706
|
+
end
|
|
1707
|
+
end
|
|
1708
|
+
|
|
1709
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::PreparedStatementInvalid') do |klass|
|
|
1710
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
1711
|
+
end
|
|
1712
|
+
|
|
1713
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::QueryCache') do |klass|
|
|
1714
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1715
|
+
|
|
1716
|
+
klass.define_instance_method('call') do |method|
|
|
1717
|
+
method.define_argument('env')
|
|
1718
|
+
end
|
|
1719
|
+
end
|
|
1720
|
+
|
|
1721
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::QueryMethods') do |klass|
|
|
1722
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
1723
|
+
|
|
1724
|
+
klass.define_instance_method('arel')
|
|
1725
|
+
|
|
1726
|
+
klass.define_instance_method('bind') do |method|
|
|
1727
|
+
method.define_argument('value')
|
|
1728
|
+
end
|
|
1729
|
+
|
|
1730
|
+
klass.define_instance_method('bind!') do |method|
|
|
1731
|
+
method.define_argument('value')
|
|
1732
|
+
end
|
|
1733
|
+
|
|
1734
|
+
klass.define_instance_method('bind_values')
|
|
1735
|
+
|
|
1736
|
+
klass.define_instance_method('bind_values=') do |method|
|
|
1737
|
+
method.define_argument('values')
|
|
1738
|
+
end
|
|
1739
|
+
|
|
1740
|
+
klass.define_instance_method('build_arel')
|
|
1741
|
+
|
|
1742
|
+
klass.define_instance_method('create_with') do |method|
|
|
1743
|
+
method.define_argument('value')
|
|
1744
|
+
end
|
|
1745
|
+
|
|
1746
|
+
klass.define_instance_method('create_with!') do |method|
|
|
1747
|
+
method.define_argument('value')
|
|
1748
|
+
end
|
|
1749
|
+
|
|
1750
|
+
klass.define_instance_method('create_with_value')
|
|
1751
|
+
|
|
1752
|
+
klass.define_instance_method('create_with_value=') do |method|
|
|
1753
|
+
method.define_argument('value')
|
|
1754
|
+
end
|
|
1755
|
+
|
|
1756
|
+
klass.define_instance_method('distinct') do |method|
|
|
1757
|
+
method.define_optional_argument('value')
|
|
1758
|
+
end
|
|
1759
|
+
|
|
1760
|
+
klass.define_instance_method('distinct!') do |method|
|
|
1761
|
+
method.define_optional_argument('value')
|
|
1762
|
+
end
|
|
1763
|
+
|
|
1764
|
+
klass.define_instance_method('distinct_value')
|
|
1765
|
+
|
|
1766
|
+
klass.define_instance_method('distinct_value=') do |method|
|
|
1767
|
+
method.define_argument('value')
|
|
1768
|
+
end
|
|
1769
|
+
|
|
1770
|
+
klass.define_instance_method('eager_load') do |method|
|
|
1771
|
+
method.define_rest_argument('args')
|
|
1772
|
+
end
|
|
1773
|
+
|
|
1774
|
+
klass.define_instance_method('eager_load!') do |method|
|
|
1775
|
+
method.define_rest_argument('args')
|
|
1776
|
+
end
|
|
1777
|
+
|
|
1778
|
+
klass.define_instance_method('eager_load_values')
|
|
1779
|
+
|
|
1780
|
+
klass.define_instance_method('eager_load_values=') do |method|
|
|
1781
|
+
method.define_argument('values')
|
|
1782
|
+
end
|
|
1783
|
+
|
|
1784
|
+
klass.define_instance_method('extending') do |method|
|
|
1785
|
+
method.define_rest_argument('modules')
|
|
1786
|
+
method.define_block_argument('block')
|
|
1787
|
+
end
|
|
1788
|
+
|
|
1789
|
+
klass.define_instance_method('extending!') do |method|
|
|
1790
|
+
method.define_rest_argument('modules')
|
|
1791
|
+
method.define_block_argument('block')
|
|
1792
|
+
end
|
|
1793
|
+
|
|
1794
|
+
klass.define_instance_method('extending_values')
|
|
1795
|
+
|
|
1796
|
+
klass.define_instance_method('extending_values=') do |method|
|
|
1797
|
+
method.define_argument('values')
|
|
1798
|
+
end
|
|
1799
|
+
|
|
1800
|
+
klass.define_instance_method('extensions')
|
|
1801
|
+
|
|
1802
|
+
klass.define_instance_method('from') do |method|
|
|
1803
|
+
method.define_argument('value')
|
|
1804
|
+
method.define_optional_argument('subquery_name')
|
|
1805
|
+
end
|
|
1806
|
+
|
|
1807
|
+
klass.define_instance_method('from!') do |method|
|
|
1808
|
+
method.define_argument('value')
|
|
1809
|
+
method.define_optional_argument('subquery_name')
|
|
1810
|
+
end
|
|
1811
|
+
|
|
1812
|
+
klass.define_instance_method('from_value')
|
|
1813
|
+
|
|
1814
|
+
klass.define_instance_method('from_value=') do |method|
|
|
1815
|
+
method.define_argument('value')
|
|
1816
|
+
end
|
|
1817
|
+
|
|
1818
|
+
klass.define_instance_method('group') do |method|
|
|
1819
|
+
method.define_rest_argument('args')
|
|
1820
|
+
end
|
|
1821
|
+
|
|
1822
|
+
klass.define_instance_method('group!') do |method|
|
|
1823
|
+
method.define_rest_argument('args')
|
|
1824
|
+
end
|
|
1825
|
+
|
|
1826
|
+
klass.define_instance_method('group_values')
|
|
1827
|
+
|
|
1828
|
+
klass.define_instance_method('group_values=') do |method|
|
|
1829
|
+
method.define_argument('values')
|
|
1830
|
+
end
|
|
1831
|
+
|
|
1832
|
+
klass.define_instance_method('having') do |method|
|
|
1833
|
+
method.define_argument('opts')
|
|
1834
|
+
method.define_rest_argument('rest')
|
|
1835
|
+
end
|
|
1836
|
+
|
|
1837
|
+
klass.define_instance_method('having!') do |method|
|
|
1838
|
+
method.define_argument('opts')
|
|
1839
|
+
method.define_rest_argument('rest')
|
|
1840
|
+
end
|
|
1841
|
+
|
|
1842
|
+
klass.define_instance_method('having_values')
|
|
1843
|
+
|
|
1844
|
+
klass.define_instance_method('having_values=') do |method|
|
|
1845
|
+
method.define_argument('values')
|
|
1846
|
+
end
|
|
1847
|
+
|
|
1848
|
+
klass.define_instance_method('includes') do |method|
|
|
1849
|
+
method.define_rest_argument('args')
|
|
1850
|
+
end
|
|
1851
|
+
|
|
1852
|
+
klass.define_instance_method('includes!') do |method|
|
|
1853
|
+
method.define_rest_argument('args')
|
|
1854
|
+
end
|
|
1855
|
+
|
|
1856
|
+
klass.define_instance_method('includes_values')
|
|
1857
|
+
|
|
1858
|
+
klass.define_instance_method('includes_values=') do |method|
|
|
1859
|
+
method.define_argument('values')
|
|
1860
|
+
end
|
|
1861
|
+
|
|
1862
|
+
klass.define_instance_method('joins') do |method|
|
|
1863
|
+
method.define_rest_argument('args')
|
|
1864
|
+
end
|
|
1865
|
+
|
|
1866
|
+
klass.define_instance_method('joins!') do |method|
|
|
1867
|
+
method.define_rest_argument('args')
|
|
1868
|
+
end
|
|
1869
|
+
|
|
1870
|
+
klass.define_instance_method('joins_values')
|
|
1871
|
+
|
|
1872
|
+
klass.define_instance_method('joins_values=') do |method|
|
|
1873
|
+
method.define_argument('values')
|
|
1874
|
+
end
|
|
1875
|
+
|
|
1876
|
+
klass.define_instance_method('limit') do |method|
|
|
1877
|
+
method.define_argument('value')
|
|
1878
|
+
end
|
|
1879
|
+
|
|
1880
|
+
klass.define_instance_method('limit!') do |method|
|
|
1881
|
+
method.define_argument('value')
|
|
1882
|
+
end
|
|
1883
|
+
|
|
1884
|
+
klass.define_instance_method('limit_value')
|
|
1885
|
+
|
|
1886
|
+
klass.define_instance_method('limit_value=') do |method|
|
|
1887
|
+
method.define_argument('value')
|
|
1888
|
+
end
|
|
1889
|
+
|
|
1890
|
+
klass.define_instance_method('lock') do |method|
|
|
1891
|
+
method.define_optional_argument('locks')
|
|
1892
|
+
end
|
|
1893
|
+
|
|
1894
|
+
klass.define_instance_method('lock!') do |method|
|
|
1895
|
+
method.define_optional_argument('locks')
|
|
1896
|
+
end
|
|
1897
|
+
|
|
1898
|
+
klass.define_instance_method('lock_value')
|
|
1899
|
+
|
|
1900
|
+
klass.define_instance_method('lock_value=') do |method|
|
|
1901
|
+
method.define_argument('value')
|
|
1902
|
+
end
|
|
1903
|
+
|
|
1904
|
+
klass.define_instance_method('none')
|
|
1905
|
+
|
|
1906
|
+
klass.define_instance_method('none!')
|
|
1907
|
+
|
|
1908
|
+
klass.define_instance_method('offset') do |method|
|
|
1909
|
+
method.define_argument('value')
|
|
1910
|
+
end
|
|
1911
|
+
|
|
1912
|
+
klass.define_instance_method('offset!') do |method|
|
|
1913
|
+
method.define_argument('value')
|
|
1914
|
+
end
|
|
1915
|
+
|
|
1916
|
+
klass.define_instance_method('offset_value')
|
|
1917
|
+
|
|
1918
|
+
klass.define_instance_method('offset_value=') do |method|
|
|
1919
|
+
method.define_argument('value')
|
|
1920
|
+
end
|
|
1921
|
+
|
|
1922
|
+
klass.define_instance_method('order') do |method|
|
|
1923
|
+
method.define_rest_argument('args')
|
|
1924
|
+
end
|
|
1925
|
+
|
|
1926
|
+
klass.define_instance_method('order!') do |method|
|
|
1927
|
+
method.define_rest_argument('args')
|
|
1928
|
+
end
|
|
1929
|
+
|
|
1930
|
+
klass.define_instance_method('order_values')
|
|
1931
|
+
|
|
1932
|
+
klass.define_instance_method('order_values=') do |method|
|
|
1933
|
+
method.define_argument('values')
|
|
1934
|
+
end
|
|
1935
|
+
|
|
1936
|
+
klass.define_instance_method('preload') do |method|
|
|
1937
|
+
method.define_rest_argument('args')
|
|
1938
|
+
end
|
|
1939
|
+
|
|
1940
|
+
klass.define_instance_method('preload!') do |method|
|
|
1941
|
+
method.define_rest_argument('args')
|
|
1942
|
+
end
|
|
1943
|
+
|
|
1944
|
+
klass.define_instance_method('preload_values')
|
|
1945
|
+
|
|
1946
|
+
klass.define_instance_method('preload_values=') do |method|
|
|
1947
|
+
method.define_argument('values')
|
|
1948
|
+
end
|
|
1949
|
+
|
|
1950
|
+
klass.define_instance_method('readonly') do |method|
|
|
1951
|
+
method.define_optional_argument('value')
|
|
1952
|
+
end
|
|
1953
|
+
|
|
1954
|
+
klass.define_instance_method('readonly!') do |method|
|
|
1955
|
+
method.define_optional_argument('value')
|
|
1956
|
+
end
|
|
1957
|
+
|
|
1958
|
+
klass.define_instance_method('readonly_value')
|
|
1959
|
+
|
|
1960
|
+
klass.define_instance_method('readonly_value=') do |method|
|
|
1961
|
+
method.define_argument('value')
|
|
1962
|
+
end
|
|
1963
|
+
|
|
1964
|
+
klass.define_instance_method('references') do |method|
|
|
1965
|
+
method.define_rest_argument('args')
|
|
1966
|
+
end
|
|
1967
|
+
|
|
1968
|
+
klass.define_instance_method('references!') do |method|
|
|
1969
|
+
method.define_rest_argument('args')
|
|
1970
|
+
end
|
|
1971
|
+
|
|
1972
|
+
klass.define_instance_method('references_values')
|
|
1973
|
+
|
|
1974
|
+
klass.define_instance_method('references_values=') do |method|
|
|
1975
|
+
method.define_argument('values')
|
|
1976
|
+
end
|
|
1977
|
+
|
|
1978
|
+
klass.define_instance_method('reorder') do |method|
|
|
1979
|
+
method.define_rest_argument('args')
|
|
1980
|
+
end
|
|
1981
|
+
|
|
1982
|
+
klass.define_instance_method('reorder!') do |method|
|
|
1983
|
+
method.define_rest_argument('args')
|
|
1984
|
+
end
|
|
1985
|
+
|
|
1986
|
+
klass.define_instance_method('reordering_value')
|
|
1987
|
+
|
|
1988
|
+
klass.define_instance_method('reordering_value=') do |method|
|
|
1989
|
+
method.define_argument('value')
|
|
1990
|
+
end
|
|
1991
|
+
|
|
1992
|
+
klass.define_instance_method('reverse_order')
|
|
1993
|
+
|
|
1994
|
+
klass.define_instance_method('reverse_order!')
|
|
1995
|
+
|
|
1996
|
+
klass.define_instance_method('reverse_order_value')
|
|
1997
|
+
|
|
1998
|
+
klass.define_instance_method('reverse_order_value=') do |method|
|
|
1999
|
+
method.define_argument('value')
|
|
2000
|
+
end
|
|
2001
|
+
|
|
2002
|
+
klass.define_instance_method('select') do |method|
|
|
2003
|
+
method.define_rest_argument('fields')
|
|
2004
|
+
end
|
|
2005
|
+
|
|
2006
|
+
klass.define_instance_method('select!') do |method|
|
|
2007
|
+
method.define_rest_argument('fields')
|
|
2008
|
+
end
|
|
2009
|
+
|
|
2010
|
+
klass.define_instance_method('select_values')
|
|
2011
|
+
|
|
2012
|
+
klass.define_instance_method('select_values=') do |method|
|
|
2013
|
+
method.define_argument('values')
|
|
2014
|
+
end
|
|
2015
|
+
|
|
2016
|
+
klass.define_instance_method('uniq') do |method|
|
|
2017
|
+
method.define_optional_argument('value')
|
|
2018
|
+
end
|
|
2019
|
+
|
|
2020
|
+
klass.define_instance_method('uniq!') do |method|
|
|
2021
|
+
method.define_optional_argument('value')
|
|
2022
|
+
end
|
|
2023
|
+
|
|
2024
|
+
klass.define_instance_method('uniq_value')
|
|
2025
|
+
|
|
2026
|
+
klass.define_instance_method('uniq_value=') do |method|
|
|
2027
|
+
method.define_argument('value')
|
|
2028
|
+
end
|
|
2029
|
+
|
|
2030
|
+
klass.define_instance_method('unscope') do |method|
|
|
2031
|
+
method.define_rest_argument('args')
|
|
2032
|
+
end
|
|
2033
|
+
|
|
2034
|
+
klass.define_instance_method('unscope!') do |method|
|
|
2035
|
+
method.define_rest_argument('args')
|
|
2036
|
+
end
|
|
2037
|
+
|
|
2038
|
+
klass.define_instance_method('where') do |method|
|
|
2039
|
+
method.define_optional_argument('opts')
|
|
2040
|
+
method.define_rest_argument('rest')
|
|
2041
|
+
end
|
|
2042
|
+
|
|
2043
|
+
klass.define_instance_method('where!') do |method|
|
|
2044
|
+
method.define_optional_argument('opts')
|
|
2045
|
+
method.define_rest_argument('rest')
|
|
2046
|
+
end
|
|
2047
|
+
|
|
2048
|
+
klass.define_instance_method('where_values')
|
|
2049
|
+
|
|
2050
|
+
klass.define_instance_method('where_values=') do |method|
|
|
2051
|
+
method.define_argument('values')
|
|
2052
|
+
end
|
|
2053
|
+
end
|
|
2054
|
+
|
|
2055
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Querying') do |klass|
|
|
2056
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2057
|
+
|
|
2058
|
+
klass.define_instance_method('any?') do |method|
|
|
2059
|
+
method.define_rest_argument('args')
|
|
2060
|
+
method.define_block_argument('block')
|
|
2061
|
+
end
|
|
2062
|
+
|
|
2063
|
+
klass.define_instance_method('average') do |method|
|
|
2064
|
+
method.define_rest_argument('args')
|
|
2065
|
+
method.define_block_argument('block')
|
|
2066
|
+
end
|
|
2067
|
+
|
|
2068
|
+
klass.define_instance_method('calculate') do |method|
|
|
2069
|
+
method.define_rest_argument('args')
|
|
2070
|
+
method.define_block_argument('block')
|
|
2071
|
+
end
|
|
2072
|
+
|
|
2073
|
+
klass.define_instance_method('count') do |method|
|
|
2074
|
+
method.define_rest_argument('args')
|
|
2075
|
+
method.define_block_argument('block')
|
|
2076
|
+
end
|
|
2077
|
+
|
|
2078
|
+
klass.define_instance_method('count_by_sql') do |method|
|
|
2079
|
+
method.define_argument('sql')
|
|
2080
|
+
end
|
|
2081
|
+
|
|
2082
|
+
klass.define_instance_method('create_with') do |method|
|
|
2083
|
+
method.define_rest_argument('args')
|
|
2084
|
+
method.define_block_argument('block')
|
|
2085
|
+
end
|
|
2086
|
+
|
|
2087
|
+
klass.define_instance_method('delete') do |method|
|
|
2088
|
+
method.define_rest_argument('args')
|
|
2089
|
+
method.define_block_argument('block')
|
|
2090
|
+
end
|
|
2091
|
+
|
|
2092
|
+
klass.define_instance_method('delete_all') do |method|
|
|
2093
|
+
method.define_rest_argument('args')
|
|
2094
|
+
method.define_block_argument('block')
|
|
2095
|
+
end
|
|
2096
|
+
|
|
2097
|
+
klass.define_instance_method('destroy') do |method|
|
|
2098
|
+
method.define_rest_argument('args')
|
|
2099
|
+
method.define_block_argument('block')
|
|
2100
|
+
end
|
|
2101
|
+
|
|
2102
|
+
klass.define_instance_method('destroy_all') do |method|
|
|
2103
|
+
method.define_rest_argument('args')
|
|
2104
|
+
method.define_block_argument('block')
|
|
2105
|
+
end
|
|
2106
|
+
|
|
2107
|
+
klass.define_instance_method('distinct') do |method|
|
|
2108
|
+
method.define_rest_argument('args')
|
|
2109
|
+
method.define_block_argument('block')
|
|
2110
|
+
end
|
|
2111
|
+
|
|
2112
|
+
klass.define_instance_method('eager_load') do |method|
|
|
2113
|
+
method.define_rest_argument('args')
|
|
2114
|
+
method.define_block_argument('block')
|
|
2115
|
+
end
|
|
2116
|
+
|
|
2117
|
+
klass.define_instance_method('except') do |method|
|
|
2118
|
+
method.define_rest_argument('args')
|
|
2119
|
+
method.define_block_argument('block')
|
|
2120
|
+
end
|
|
2121
|
+
|
|
2122
|
+
klass.define_instance_method('exists?') do |method|
|
|
2123
|
+
method.define_rest_argument('args')
|
|
2124
|
+
method.define_block_argument('block')
|
|
2125
|
+
end
|
|
2126
|
+
|
|
2127
|
+
klass.define_instance_method('find') do |method|
|
|
2128
|
+
method.define_rest_argument('args')
|
|
2129
|
+
method.define_block_argument('block')
|
|
2130
|
+
end
|
|
2131
|
+
|
|
2132
|
+
klass.define_instance_method('find_by') do |method|
|
|
2133
|
+
method.define_rest_argument('args')
|
|
2134
|
+
method.define_block_argument('block')
|
|
2135
|
+
end
|
|
2136
|
+
|
|
2137
|
+
klass.define_instance_method('find_by!') do |method|
|
|
2138
|
+
method.define_rest_argument('args')
|
|
2139
|
+
method.define_block_argument('block')
|
|
2140
|
+
end
|
|
2141
|
+
|
|
2142
|
+
klass.define_instance_method('find_by_sql') do |method|
|
|
2143
|
+
method.define_argument('sql')
|
|
2144
|
+
method.define_optional_argument('binds')
|
|
2145
|
+
end
|
|
2146
|
+
|
|
2147
|
+
klass.define_instance_method('find_each') do |method|
|
|
2148
|
+
method.define_rest_argument('args')
|
|
2149
|
+
method.define_block_argument('block')
|
|
2150
|
+
end
|
|
2151
|
+
|
|
2152
|
+
klass.define_instance_method('find_in_batches') do |method|
|
|
2153
|
+
method.define_rest_argument('args')
|
|
2154
|
+
method.define_block_argument('block')
|
|
2155
|
+
end
|
|
2156
|
+
|
|
2157
|
+
klass.define_instance_method('find_or_create_by') do |method|
|
|
2158
|
+
method.define_rest_argument('args')
|
|
2159
|
+
method.define_block_argument('block')
|
|
2160
|
+
end
|
|
2161
|
+
|
|
2162
|
+
klass.define_instance_method('find_or_create_by!') do |method|
|
|
2163
|
+
method.define_rest_argument('args')
|
|
2164
|
+
method.define_block_argument('block')
|
|
2165
|
+
end
|
|
2166
|
+
|
|
2167
|
+
klass.define_instance_method('find_or_initialize_by') do |method|
|
|
2168
|
+
method.define_rest_argument('args')
|
|
2169
|
+
method.define_block_argument('block')
|
|
2170
|
+
end
|
|
2171
|
+
|
|
2172
|
+
klass.define_instance_method('first') do |method|
|
|
2173
|
+
method.define_rest_argument('args')
|
|
2174
|
+
method.define_block_argument('block')
|
|
2175
|
+
end
|
|
2176
|
+
|
|
2177
|
+
klass.define_instance_method('first!') do |method|
|
|
2178
|
+
method.define_rest_argument('args')
|
|
2179
|
+
method.define_block_argument('block')
|
|
2180
|
+
end
|
|
2181
|
+
|
|
2182
|
+
klass.define_instance_method('first_or_create') do |method|
|
|
2183
|
+
method.define_rest_argument('args')
|
|
2184
|
+
method.define_block_argument('block')
|
|
2185
|
+
end
|
|
2186
|
+
|
|
2187
|
+
klass.define_instance_method('first_or_create!') do |method|
|
|
2188
|
+
method.define_rest_argument('args')
|
|
2189
|
+
method.define_block_argument('block')
|
|
2190
|
+
end
|
|
2191
|
+
|
|
2192
|
+
klass.define_instance_method('first_or_initialize') do |method|
|
|
2193
|
+
method.define_rest_argument('args')
|
|
2194
|
+
method.define_block_argument('block')
|
|
2195
|
+
end
|
|
2196
|
+
|
|
2197
|
+
klass.define_instance_method('from') do |method|
|
|
2198
|
+
method.define_rest_argument('args')
|
|
2199
|
+
method.define_block_argument('block')
|
|
2200
|
+
end
|
|
2201
|
+
|
|
2202
|
+
klass.define_instance_method('group') do |method|
|
|
2203
|
+
method.define_rest_argument('args')
|
|
2204
|
+
method.define_block_argument('block')
|
|
2205
|
+
end
|
|
2206
|
+
|
|
2207
|
+
klass.define_instance_method('having') do |method|
|
|
2208
|
+
method.define_rest_argument('args')
|
|
2209
|
+
method.define_block_argument('block')
|
|
2210
|
+
end
|
|
2211
|
+
|
|
2212
|
+
klass.define_instance_method('ids') do |method|
|
|
2213
|
+
method.define_rest_argument('args')
|
|
2214
|
+
method.define_block_argument('block')
|
|
2215
|
+
end
|
|
2216
|
+
|
|
2217
|
+
klass.define_instance_method('includes') do |method|
|
|
2218
|
+
method.define_rest_argument('args')
|
|
2219
|
+
method.define_block_argument('block')
|
|
2220
|
+
end
|
|
2221
|
+
|
|
2222
|
+
klass.define_instance_method('joins') do |method|
|
|
2223
|
+
method.define_rest_argument('args')
|
|
2224
|
+
method.define_block_argument('block')
|
|
2225
|
+
end
|
|
2226
|
+
|
|
2227
|
+
klass.define_instance_method('last') do |method|
|
|
2228
|
+
method.define_rest_argument('args')
|
|
2229
|
+
method.define_block_argument('block')
|
|
2230
|
+
end
|
|
2231
|
+
|
|
2232
|
+
klass.define_instance_method('last!') do |method|
|
|
2233
|
+
method.define_rest_argument('args')
|
|
2234
|
+
method.define_block_argument('block')
|
|
2235
|
+
end
|
|
2236
|
+
|
|
2237
|
+
klass.define_instance_method('limit') do |method|
|
|
2238
|
+
method.define_rest_argument('args')
|
|
2239
|
+
method.define_block_argument('block')
|
|
2240
|
+
end
|
|
2241
|
+
|
|
2242
|
+
klass.define_instance_method('lock') do |method|
|
|
2243
|
+
method.define_rest_argument('args')
|
|
2244
|
+
method.define_block_argument('block')
|
|
2245
|
+
end
|
|
2246
|
+
|
|
2247
|
+
klass.define_instance_method('many?') do |method|
|
|
2248
|
+
method.define_rest_argument('args')
|
|
2249
|
+
method.define_block_argument('block')
|
|
2250
|
+
end
|
|
2251
|
+
|
|
2252
|
+
klass.define_instance_method('maximum') do |method|
|
|
2253
|
+
method.define_rest_argument('args')
|
|
2254
|
+
method.define_block_argument('block')
|
|
2255
|
+
end
|
|
2256
|
+
|
|
2257
|
+
klass.define_instance_method('minimum') do |method|
|
|
2258
|
+
method.define_rest_argument('args')
|
|
2259
|
+
method.define_block_argument('block')
|
|
2260
|
+
end
|
|
2261
|
+
|
|
2262
|
+
klass.define_instance_method('none') do |method|
|
|
2263
|
+
method.define_rest_argument('args')
|
|
2264
|
+
method.define_block_argument('block')
|
|
2265
|
+
end
|
|
2266
|
+
|
|
2267
|
+
klass.define_instance_method('offset') do |method|
|
|
2268
|
+
method.define_rest_argument('args')
|
|
2269
|
+
method.define_block_argument('block')
|
|
2270
|
+
end
|
|
2271
|
+
|
|
2272
|
+
klass.define_instance_method('order') do |method|
|
|
2273
|
+
method.define_rest_argument('args')
|
|
2274
|
+
method.define_block_argument('block')
|
|
2275
|
+
end
|
|
2276
|
+
|
|
2277
|
+
klass.define_instance_method('pluck') do |method|
|
|
2278
|
+
method.define_rest_argument('args')
|
|
2279
|
+
method.define_block_argument('block')
|
|
2280
|
+
end
|
|
2281
|
+
|
|
2282
|
+
klass.define_instance_method('preload') do |method|
|
|
2283
|
+
method.define_rest_argument('args')
|
|
2284
|
+
method.define_block_argument('block')
|
|
2285
|
+
end
|
|
2286
|
+
|
|
2287
|
+
klass.define_instance_method('readonly') do |method|
|
|
2288
|
+
method.define_rest_argument('args')
|
|
2289
|
+
method.define_block_argument('block')
|
|
2290
|
+
end
|
|
2291
|
+
|
|
2292
|
+
klass.define_instance_method('references') do |method|
|
|
2293
|
+
method.define_rest_argument('args')
|
|
2294
|
+
method.define_block_argument('block')
|
|
2295
|
+
end
|
|
2296
|
+
|
|
2297
|
+
klass.define_instance_method('reorder') do |method|
|
|
2298
|
+
method.define_rest_argument('args')
|
|
2299
|
+
method.define_block_argument('block')
|
|
2300
|
+
end
|
|
2301
|
+
|
|
2302
|
+
klass.define_instance_method('select') do |method|
|
|
2303
|
+
method.define_rest_argument('args')
|
|
2304
|
+
method.define_block_argument('block')
|
|
2305
|
+
end
|
|
2306
|
+
|
|
2307
|
+
klass.define_instance_method('sum') do |method|
|
|
2308
|
+
method.define_rest_argument('args')
|
|
2309
|
+
method.define_block_argument('block')
|
|
2310
|
+
end
|
|
2311
|
+
|
|
2312
|
+
klass.define_instance_method('take') do |method|
|
|
2313
|
+
method.define_rest_argument('args')
|
|
2314
|
+
method.define_block_argument('block')
|
|
2315
|
+
end
|
|
2316
|
+
|
|
2317
|
+
klass.define_instance_method('take!') do |method|
|
|
2318
|
+
method.define_rest_argument('args')
|
|
2319
|
+
method.define_block_argument('block')
|
|
2320
|
+
end
|
|
2321
|
+
|
|
2322
|
+
klass.define_instance_method('uniq') do |method|
|
|
2323
|
+
method.define_rest_argument('args')
|
|
2324
|
+
method.define_block_argument('block')
|
|
2325
|
+
end
|
|
2326
|
+
|
|
2327
|
+
klass.define_instance_method('unscope') do |method|
|
|
2328
|
+
method.define_rest_argument('args')
|
|
2329
|
+
method.define_block_argument('block')
|
|
2330
|
+
end
|
|
2331
|
+
|
|
2332
|
+
klass.define_instance_method('update') do |method|
|
|
2333
|
+
method.define_rest_argument('args')
|
|
2334
|
+
method.define_block_argument('block')
|
|
2335
|
+
end
|
|
2336
|
+
|
|
2337
|
+
klass.define_instance_method('update_all') do |method|
|
|
2338
|
+
method.define_rest_argument('args')
|
|
2339
|
+
method.define_block_argument('block')
|
|
2340
|
+
end
|
|
2341
|
+
|
|
2342
|
+
klass.define_instance_method('where') do |method|
|
|
2343
|
+
method.define_rest_argument('args')
|
|
2344
|
+
method.define_block_argument('block')
|
|
2345
|
+
end
|
|
2346
|
+
end
|
|
2347
|
+
|
|
2348
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Railtie') do |klass|
|
|
2349
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Rails::Railtie'))
|
|
2350
|
+
end
|
|
2351
|
+
|
|
2352
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ReadOnlyAssociation') do |klass|
|
|
2353
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2354
|
+
end
|
|
2355
|
+
|
|
2356
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ReadOnlyRecord') do |klass|
|
|
2357
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2358
|
+
end
|
|
2359
|
+
|
|
2360
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ReadonlyAttributes') do |klass|
|
|
2361
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2362
|
+
|
|
2363
|
+
klass.define_instance_method('_attr_readonly')
|
|
2364
|
+
end
|
|
2365
|
+
|
|
2366
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::RecordNotDestroyed') do |klass|
|
|
2367
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2368
|
+
end
|
|
2369
|
+
|
|
2370
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::RecordNotFound') do |klass|
|
|
2371
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2372
|
+
end
|
|
2373
|
+
|
|
2374
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::RecordNotSaved') do |klass|
|
|
2375
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2376
|
+
end
|
|
2377
|
+
|
|
2378
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::RecordNotUnique') do |klass|
|
|
2379
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::WrappedDatabaseException'))
|
|
2380
|
+
end
|
|
2381
|
+
|
|
2382
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Reflection') do |klass|
|
|
2383
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2384
|
+
end
|
|
2385
|
+
|
|
2386
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Relation') do |klass|
|
|
2387
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2388
|
+
|
|
2389
|
+
klass.define_instance_method('==') do |method|
|
|
2390
|
+
method.define_argument('other')
|
|
2391
|
+
end
|
|
2392
|
+
|
|
2393
|
+
klass.define_instance_method('any?')
|
|
2394
|
+
|
|
2395
|
+
klass.define_instance_method('as_json') do |method|
|
|
2396
|
+
method.define_optional_argument('options')
|
|
2397
|
+
end
|
|
2398
|
+
|
|
2399
|
+
klass.define_instance_method('blank?')
|
|
2400
|
+
|
|
2401
|
+
klass.define_instance_method('build') do |method|
|
|
2402
|
+
method.define_rest_argument('args')
|
|
2403
|
+
method.define_block_argument('block')
|
|
2404
|
+
end
|
|
2405
|
+
|
|
2406
|
+
klass.define_instance_method('create') do |method|
|
|
2407
|
+
method.define_rest_argument('args')
|
|
2408
|
+
method.define_block_argument('block')
|
|
2409
|
+
end
|
|
2410
|
+
|
|
2411
|
+
klass.define_instance_method('create!') do |method|
|
|
2412
|
+
method.define_rest_argument('args')
|
|
2413
|
+
method.define_block_argument('block')
|
|
2414
|
+
end
|
|
2415
|
+
|
|
2416
|
+
klass.define_instance_method('default_scoped')
|
|
2417
|
+
|
|
2418
|
+
klass.define_instance_method('default_scoped=')
|
|
2419
|
+
|
|
2420
|
+
klass.define_instance_method('default_scoped?')
|
|
2421
|
+
|
|
2422
|
+
klass.define_instance_method('delete') do |method|
|
|
2423
|
+
method.define_argument('id_or_array')
|
|
2424
|
+
end
|
|
2425
|
+
|
|
2426
|
+
klass.define_instance_method('delete_all') do |method|
|
|
2427
|
+
method.define_optional_argument('conditions')
|
|
2428
|
+
end
|
|
2429
|
+
|
|
2430
|
+
klass.define_instance_method('destroy') do |method|
|
|
2431
|
+
method.define_argument('id')
|
|
2432
|
+
end
|
|
2433
|
+
|
|
2434
|
+
klass.define_instance_method('destroy_all') do |method|
|
|
2435
|
+
method.define_optional_argument('conditions')
|
|
2436
|
+
end
|
|
2437
|
+
|
|
2438
|
+
klass.define_instance_method('eager_loading?')
|
|
2439
|
+
|
|
2440
|
+
klass.define_instance_method('empty?')
|
|
2441
|
+
|
|
2442
|
+
klass.define_instance_method('explain')
|
|
2443
|
+
|
|
2444
|
+
klass.define_instance_method('find_or_create_by') do |method|
|
|
2445
|
+
method.define_argument('attributes')
|
|
2446
|
+
method.define_block_argument('block')
|
|
2447
|
+
end
|
|
2448
|
+
|
|
2449
|
+
klass.define_instance_method('find_or_create_by!') do |method|
|
|
2450
|
+
method.define_argument('attributes')
|
|
2451
|
+
method.define_block_argument('block')
|
|
2452
|
+
end
|
|
2453
|
+
|
|
2454
|
+
klass.define_instance_method('find_or_initialize_by') do |method|
|
|
2455
|
+
method.define_argument('attributes')
|
|
2456
|
+
method.define_block_argument('block')
|
|
2457
|
+
end
|
|
2458
|
+
|
|
2459
|
+
klass.define_instance_method('first_or_create') do |method|
|
|
2460
|
+
method.define_optional_argument('attributes')
|
|
2461
|
+
method.define_block_argument('block')
|
|
2462
|
+
end
|
|
2463
|
+
|
|
2464
|
+
klass.define_instance_method('first_or_create!') do |method|
|
|
2465
|
+
method.define_optional_argument('attributes')
|
|
2466
|
+
method.define_block_argument('block')
|
|
2467
|
+
end
|
|
2468
|
+
|
|
2469
|
+
klass.define_instance_method('first_or_initialize') do |method|
|
|
2470
|
+
method.define_optional_argument('attributes')
|
|
2471
|
+
method.define_block_argument('block')
|
|
2472
|
+
end
|
|
2473
|
+
|
|
2474
|
+
klass.define_instance_method('insert') do |method|
|
|
2475
|
+
method.define_argument('values')
|
|
2476
|
+
end
|
|
2477
|
+
|
|
2478
|
+
klass.define_instance_method('inspect')
|
|
2479
|
+
|
|
2480
|
+
klass.define_instance_method('joined_includes_values')
|
|
2481
|
+
|
|
2482
|
+
klass.define_instance_method('klass')
|
|
2483
|
+
|
|
2484
|
+
klass.define_instance_method('load')
|
|
2485
|
+
|
|
2486
|
+
klass.define_instance_method('loaded')
|
|
2487
|
+
|
|
2488
|
+
klass.define_instance_method('loaded?')
|
|
2489
|
+
|
|
2490
|
+
klass.define_instance_method('many?')
|
|
2491
|
+
|
|
2492
|
+
klass.define_instance_method('model')
|
|
2493
|
+
|
|
2494
|
+
klass.define_instance_method('new') do |method|
|
|
2495
|
+
method.define_rest_argument('args')
|
|
2496
|
+
method.define_block_argument('block')
|
|
2497
|
+
end
|
|
2498
|
+
|
|
2499
|
+
klass.define_instance_method('pretty_print') do |method|
|
|
2500
|
+
method.define_argument('q')
|
|
2501
|
+
end
|
|
2502
|
+
|
|
2503
|
+
klass.define_instance_method('proxy_association')
|
|
2504
|
+
|
|
2505
|
+
klass.define_instance_method('proxy_association=')
|
|
2506
|
+
|
|
2507
|
+
klass.define_instance_method('reload')
|
|
2508
|
+
|
|
2509
|
+
klass.define_instance_method('reset')
|
|
2510
|
+
|
|
2511
|
+
klass.define_instance_method('scope_for_create')
|
|
2512
|
+
|
|
2513
|
+
klass.define_instance_method('scoping')
|
|
2514
|
+
|
|
2515
|
+
klass.define_instance_method('size')
|
|
2516
|
+
|
|
2517
|
+
klass.define_instance_method('table')
|
|
2518
|
+
|
|
2519
|
+
klass.define_instance_method('to_a')
|
|
2520
|
+
|
|
2521
|
+
klass.define_instance_method('to_sql')
|
|
2522
|
+
|
|
2523
|
+
klass.define_instance_method('uniq_value')
|
|
2524
|
+
|
|
2525
|
+
klass.define_instance_method('update') do |method|
|
|
2526
|
+
method.define_argument('id')
|
|
2527
|
+
method.define_argument('attributes')
|
|
2528
|
+
end
|
|
2529
|
+
|
|
2530
|
+
klass.define_instance_method('update_all') do |method|
|
|
2531
|
+
method.define_argument('updates')
|
|
2532
|
+
method.define_optional_argument('conditions')
|
|
2533
|
+
method.define_optional_argument('options')
|
|
2534
|
+
end
|
|
2535
|
+
|
|
2536
|
+
klass.define_instance_method('update_all_without_deprecated_options') do |method|
|
|
2537
|
+
method.define_argument('updates')
|
|
2538
|
+
end
|
|
2539
|
+
|
|
2540
|
+
klass.define_instance_method('values')
|
|
2541
|
+
|
|
2542
|
+
klass.define_instance_method('where_values_hash')
|
|
2543
|
+
|
|
2544
|
+
klass.define_instance_method('with_default_scope')
|
|
2545
|
+
end
|
|
2546
|
+
|
|
2547
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Result') do |klass|
|
|
2548
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2549
|
+
|
|
2550
|
+
klass.define_instance_method('[]') do |method|
|
|
2551
|
+
method.define_argument('idx')
|
|
2552
|
+
end
|
|
2553
|
+
|
|
2554
|
+
klass.define_instance_method('collect!')
|
|
2555
|
+
|
|
2556
|
+
klass.define_instance_method('column_types')
|
|
2557
|
+
|
|
2558
|
+
klass.define_instance_method('columns')
|
|
2559
|
+
|
|
2560
|
+
klass.define_instance_method('each')
|
|
2561
|
+
|
|
2562
|
+
klass.define_instance_method('empty?')
|
|
2563
|
+
|
|
2564
|
+
klass.define_instance_method('last')
|
|
2565
|
+
|
|
2566
|
+
klass.define_instance_method('map!')
|
|
2567
|
+
|
|
2568
|
+
klass.define_instance_method('rows')
|
|
2569
|
+
|
|
2570
|
+
klass.define_instance_method('to_ary')
|
|
2571
|
+
|
|
2572
|
+
klass.define_instance_method('to_hash')
|
|
2573
|
+
end
|
|
2574
|
+
|
|
2575
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Rollback') do |klass|
|
|
2576
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2577
|
+
end
|
|
2578
|
+
|
|
2579
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::RuntimeRegistry') do |klass|
|
|
2580
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2581
|
+
|
|
2582
|
+
klass.define_instance_method('connection_handler')
|
|
2583
|
+
|
|
2584
|
+
klass.define_instance_method('connection_handler=')
|
|
2585
|
+
|
|
2586
|
+
klass.define_instance_method('connection_id')
|
|
2587
|
+
|
|
2588
|
+
klass.define_instance_method('connection_id=')
|
|
2589
|
+
|
|
2590
|
+
klass.define_instance_method('sql_runtime')
|
|
2591
|
+
|
|
2592
|
+
klass.define_instance_method('sql_runtime=')
|
|
2593
|
+
end
|
|
2594
|
+
|
|
2595
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Sanitization') do |klass|
|
|
2596
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2597
|
+
|
|
2598
|
+
klass.define_instance_method('quoted_id')
|
|
2599
|
+
end
|
|
2600
|
+
|
|
2601
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Schema') do |klass|
|
|
2602
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::Migration'))
|
|
2603
|
+
|
|
2604
|
+
klass.define_method('define') do |method|
|
|
2605
|
+
method.define_optional_argument('info')
|
|
2606
|
+
method.define_block_argument('block')
|
|
2607
|
+
end
|
|
2608
|
+
|
|
2609
|
+
klass.define_instance_method('define') do |method|
|
|
2610
|
+
method.define_argument('info')
|
|
2611
|
+
method.define_block_argument('block')
|
|
2612
|
+
end
|
|
2613
|
+
|
|
2614
|
+
klass.define_instance_method('migrations_paths')
|
|
2615
|
+
end
|
|
2616
|
+
|
|
2617
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::SchemaDumper') do |klass|
|
|
2618
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2619
|
+
|
|
2620
|
+
klass.define_method('dump') do |method|
|
|
2621
|
+
method.define_optional_argument('connection')
|
|
2622
|
+
method.define_optional_argument('stream')
|
|
2623
|
+
end
|
|
2624
|
+
|
|
2625
|
+
klass.define_method('ignore_tables')
|
|
2626
|
+
|
|
2627
|
+
klass.define_method('ignore_tables=') do |method|
|
|
2628
|
+
method.define_argument('obj')
|
|
2629
|
+
end
|
|
2630
|
+
|
|
2631
|
+
klass.define_instance_method('dump') do |method|
|
|
2632
|
+
method.define_argument('stream')
|
|
2633
|
+
end
|
|
2634
|
+
|
|
2635
|
+
klass.define_instance_method('ignore_tables')
|
|
2636
|
+
|
|
2637
|
+
klass.define_instance_method('ignore_tables=') do |method|
|
|
2638
|
+
method.define_argument('obj')
|
|
2639
|
+
end
|
|
2640
|
+
end
|
|
2641
|
+
|
|
2642
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::SchemaMigration') do |klass|
|
|
2643
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::Base'))
|
|
2644
|
+
|
|
2645
|
+
klass.define_method('_validators')
|
|
2646
|
+
|
|
2647
|
+
klass.define_method('create_table') do |method|
|
|
2648
|
+
method.define_optional_argument('limit')
|
|
2649
|
+
end
|
|
2650
|
+
|
|
2651
|
+
klass.define_method('drop_table')
|
|
2652
|
+
|
|
2653
|
+
klass.define_method('index_name')
|
|
2654
|
+
|
|
2655
|
+
klass.define_method('table_name')
|
|
2656
|
+
|
|
2657
|
+
klass.define_instance_method('version')
|
|
2658
|
+
end
|
|
2659
|
+
|
|
2660
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Scoping') do |klass|
|
|
2661
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2662
|
+
|
|
2663
|
+
klass.define_instance_method('populate_with_current_scope_attributes')
|
|
2664
|
+
end
|
|
2665
|
+
|
|
2666
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Serialization') do |klass|
|
|
2667
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2668
|
+
|
|
2669
|
+
klass.define_instance_method('serializable_hash') do |method|
|
|
2670
|
+
method.define_optional_argument('options')
|
|
2671
|
+
end
|
|
2672
|
+
|
|
2673
|
+
klass.define_instance_method('to_xml') do |method|
|
|
2674
|
+
method.define_optional_argument('options')
|
|
2675
|
+
method.define_block_argument('block')
|
|
2676
|
+
end
|
|
2677
|
+
end
|
|
2678
|
+
|
|
2679
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::SerializationTypeMismatch') do |klass|
|
|
2680
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2681
|
+
end
|
|
2682
|
+
|
|
2683
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::SpawnMethods') do |klass|
|
|
2684
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2685
|
+
|
|
2686
|
+
klass.define_instance_method('except') do |method|
|
|
2687
|
+
method.define_rest_argument('skips')
|
|
2688
|
+
end
|
|
2689
|
+
|
|
2690
|
+
klass.define_instance_method('merge') do |method|
|
|
2691
|
+
method.define_argument('other')
|
|
2692
|
+
end
|
|
2693
|
+
|
|
2694
|
+
klass.define_instance_method('merge!') do |method|
|
|
2695
|
+
method.define_argument('other')
|
|
2696
|
+
end
|
|
2697
|
+
|
|
2698
|
+
klass.define_instance_method('only') do |method|
|
|
2699
|
+
method.define_rest_argument('onlies')
|
|
2700
|
+
end
|
|
2701
|
+
|
|
2702
|
+
klass.define_instance_method('spawn')
|
|
2703
|
+
end
|
|
2704
|
+
|
|
2705
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::StaleObjectError') do |klass|
|
|
2706
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2707
|
+
|
|
2708
|
+
klass.define_instance_method('attempted_action')
|
|
2709
|
+
|
|
2710
|
+
klass.define_instance_method('record')
|
|
2711
|
+
end
|
|
2712
|
+
|
|
2713
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::StatementCache') do |klass|
|
|
2714
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2715
|
+
|
|
2716
|
+
klass.define_instance_method('execute')
|
|
2717
|
+
end
|
|
2718
|
+
|
|
2719
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::StatementInvalid') do |klass|
|
|
2720
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2721
|
+
|
|
2722
|
+
klass.define_instance_method('original_exception')
|
|
2723
|
+
end
|
|
2724
|
+
|
|
2725
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Store') do |klass|
|
|
2726
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2727
|
+
|
|
2728
|
+
klass.define_instance_method('read_store_attribute') do |method|
|
|
2729
|
+
method.define_argument('store_attribute')
|
|
2730
|
+
method.define_argument('key')
|
|
2731
|
+
end
|
|
2732
|
+
|
|
2733
|
+
klass.define_instance_method('write_store_attribute') do |method|
|
|
2734
|
+
method.define_argument('store_attribute')
|
|
2735
|
+
method.define_argument('key')
|
|
2736
|
+
method.define_argument('value')
|
|
2737
|
+
end
|
|
2738
|
+
end
|
|
2739
|
+
|
|
2740
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::SubclassNotFound') do |klass|
|
|
2741
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2742
|
+
end
|
|
2743
|
+
|
|
2744
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Tasks') do |klass|
|
|
2745
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2746
|
+
end
|
|
2747
|
+
|
|
2748
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::TestCase') do |klass|
|
|
2749
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveSupport::TestCase'))
|
|
2750
|
+
|
|
2751
|
+
klass.define_instance_method('assert_date_from_db') do |method|
|
|
2752
|
+
method.define_argument('expected')
|
|
2753
|
+
method.define_argument('actual')
|
|
2754
|
+
method.define_optional_argument('message')
|
|
2755
|
+
end
|
|
2756
|
+
|
|
2757
|
+
klass.define_instance_method('assert_no_queries') do |method|
|
|
2758
|
+
method.define_block_argument('block')
|
|
2759
|
+
end
|
|
2760
|
+
|
|
2761
|
+
klass.define_instance_method('assert_queries') do |method|
|
|
2762
|
+
method.define_optional_argument('num')
|
|
2763
|
+
method.define_optional_argument('options')
|
|
2764
|
+
end
|
|
2765
|
+
|
|
2766
|
+
klass.define_instance_method('assert_sql') do |method|
|
|
2767
|
+
method.define_rest_argument('patterns_to_match')
|
|
2768
|
+
end
|
|
2769
|
+
|
|
2770
|
+
klass.define_instance_method('teardown')
|
|
2771
|
+
end
|
|
2772
|
+
|
|
2773
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::TestFixtures') do |klass|
|
|
2774
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2775
|
+
|
|
2776
|
+
klass.define_instance_method('after_teardown')
|
|
2777
|
+
|
|
2778
|
+
klass.define_instance_method('before_setup')
|
|
2779
|
+
|
|
2780
|
+
klass.define_instance_method('enlist_fixture_connections')
|
|
2781
|
+
|
|
2782
|
+
klass.define_instance_method('run_in_transaction?')
|
|
2783
|
+
|
|
2784
|
+
klass.define_instance_method('setup_fixtures')
|
|
2785
|
+
|
|
2786
|
+
klass.define_instance_method('teardown_fixtures')
|
|
2787
|
+
end
|
|
2788
|
+
|
|
2789
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::ThrowResult') do |klass|
|
|
2790
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2791
|
+
end
|
|
2792
|
+
|
|
2793
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Timestamp') do |klass|
|
|
2794
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2795
|
+
|
|
2796
|
+
klass.define_instance_method('initialize_dup') do |method|
|
|
2797
|
+
method.define_argument('other')
|
|
2798
|
+
end
|
|
2799
|
+
end
|
|
2800
|
+
|
|
2801
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::TransactionIsolationError') do |klass|
|
|
2802
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2803
|
+
end
|
|
2804
|
+
|
|
2805
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Transactions') do |klass|
|
|
2806
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2807
|
+
|
|
2808
|
+
klass.define_instance_method('add_to_transaction')
|
|
2809
|
+
|
|
2810
|
+
klass.define_instance_method('clear_transaction_record_state')
|
|
2811
|
+
|
|
2812
|
+
klass.define_instance_method('committed!')
|
|
2813
|
+
|
|
2814
|
+
klass.define_instance_method('destroy')
|
|
2815
|
+
|
|
2816
|
+
klass.define_instance_method('remember_transaction_record_state')
|
|
2817
|
+
|
|
2818
|
+
klass.define_instance_method('restore_transaction_record_state') do |method|
|
|
2819
|
+
method.define_optional_argument('force')
|
|
2820
|
+
end
|
|
2821
|
+
|
|
2822
|
+
klass.define_instance_method('rollback_active_record_state!')
|
|
2823
|
+
|
|
2824
|
+
klass.define_instance_method('rolledback!') do |method|
|
|
2825
|
+
method.define_optional_argument('force_restore_state')
|
|
2826
|
+
end
|
|
2827
|
+
|
|
2828
|
+
klass.define_instance_method('save') do |method|
|
|
2829
|
+
method.define_rest_argument('')
|
|
2830
|
+
end
|
|
2831
|
+
|
|
2832
|
+
klass.define_instance_method('save!') do |method|
|
|
2833
|
+
method.define_rest_argument('')
|
|
2834
|
+
end
|
|
2835
|
+
|
|
2836
|
+
klass.define_instance_method('transaction') do |method|
|
|
2837
|
+
method.define_optional_argument('options')
|
|
2838
|
+
method.define_block_argument('block')
|
|
2839
|
+
end
|
|
2840
|
+
|
|
2841
|
+
klass.define_instance_method('transaction_include_any_action?') do |method|
|
|
2842
|
+
method.define_argument('actions')
|
|
2843
|
+
end
|
|
2844
|
+
|
|
2845
|
+
klass.define_instance_method('transaction_record_state') do |method|
|
|
2846
|
+
method.define_argument('state')
|
|
2847
|
+
end
|
|
2848
|
+
|
|
2849
|
+
klass.define_instance_method('with_transaction_returning_status')
|
|
2850
|
+
end
|
|
2851
|
+
|
|
2852
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Translation') do |klass|
|
|
2853
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2854
|
+
|
|
2855
|
+
klass.define_instance_method('i18n_scope')
|
|
2856
|
+
|
|
2857
|
+
klass.define_instance_method('lookup_ancestors')
|
|
2858
|
+
end
|
|
2859
|
+
|
|
2860
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::UnknownAttributeError') do |klass|
|
|
2861
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('NoMethodError'))
|
|
2862
|
+
end
|
|
2863
|
+
|
|
2864
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::UnknownMigrationVersionError') do |klass|
|
|
2865
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2866
|
+
end
|
|
2867
|
+
|
|
2868
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::UnknownPrimaryKey') do |klass|
|
|
2869
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::ActiveRecordError'))
|
|
2870
|
+
|
|
2871
|
+
klass.define_instance_method('model')
|
|
2872
|
+
end
|
|
2873
|
+
|
|
2874
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::VERSION') do |klass|
|
|
2875
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2876
|
+
end
|
|
2877
|
+
|
|
2878
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::Validations') do |klass|
|
|
2879
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('Object'))
|
|
2880
|
+
|
|
2881
|
+
klass.define_instance_method('perform_validations') do |method|
|
|
2882
|
+
method.define_optional_argument('options')
|
|
2883
|
+
end
|
|
2884
|
+
|
|
2885
|
+
klass.define_instance_method('save') do |method|
|
|
2886
|
+
method.define_optional_argument('options')
|
|
2887
|
+
end
|
|
2888
|
+
|
|
2889
|
+
klass.define_instance_method('save!') do |method|
|
|
2890
|
+
method.define_optional_argument('options')
|
|
2891
|
+
end
|
|
2892
|
+
|
|
2893
|
+
klass.define_instance_method('valid?') do |method|
|
|
2894
|
+
method.define_optional_argument('context')
|
|
2895
|
+
end
|
|
2896
|
+
end
|
|
2897
|
+
|
|
2898
|
+
RubyLint::VirtualMachine.global_scope.define_constant('ActiveRecord::WrappedDatabaseException') do |klass|
|
|
2899
|
+
klass.inherits(RubyLint::VirtualMachine.constant_proxy('ActiveRecord::StatementInvalid'))
|
|
2900
|
+
end
|
|
2901
|
+
|