rails_best_practices 1.19.3 → 1.19.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.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -4
- data/Gemfile.lock +120 -0
- data/README.md +4 -1
- data/lib/rails_best_practices.rb +2 -0
- data/lib/rails_best_practices/analyzer.rb +5 -4
- data/lib/rails_best_practices/cli.rb +22 -0
- data/lib/rails_best_practices/command.rb +1 -131
- data/lib/rails_best_practices/core/check.rb +24 -23
- data/lib/rails_best_practices/core/checks_loader.rb +17 -18
- data/lib/rails_best_practices/core/methods.rb +9 -8
- data/lib/rails_best_practices/core/model_associations.rb +1 -1
- data/lib/rails_best_practices/core/runner.rb +38 -38
- data/lib/rails_best_practices/option_parser.rb +140 -0
- data/lib/rails_best_practices/prepares/controller_prepare.rb +8 -14
- data/lib/rails_best_practices/prepares/gemfile_prepare.rb +1 -1
- data/lib/rails_best_practices/prepares/initializer_prepare.rb +3 -3
- data/lib/rails_best_practices/prepares/mailer_prepare.rb +1 -1
- data/lib/rails_best_practices/prepares/model_prepare.rb +13 -13
- data/lib/rails_best_practices/prepares/route_prepare.rb +16 -15
- data/lib/rails_best_practices/prepares/schema_prepare.rb +1 -1
- data/lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rb +25 -23
- data/lib/rails_best_practices/reviews/always_add_db_index_review.rb +73 -72
- data/lib/rails_best_practices/reviews/check_destroy_return_value_review.rb +2 -1
- data/lib/rails_best_practices/reviews/check_save_return_value_review.rb +4 -3
- data/lib/rails_best_practices/reviews/default_scope_is_evil_review.rb +1 -1
- data/lib/rails_best_practices/reviews/dry_bundler_in_capistrano_review.rb +1 -1
- data/lib/rails_best_practices/reviews/hash_syntax_review.rb +11 -11
- data/lib/rails_best_practices/reviews/isolate_seed_data_review.rb +8 -8
- data/lib/rails_best_practices/reviews/keep_finders_on_their_own_model_review.rb +5 -5
- data/lib/rails_best_practices/reviews/law_of_demeter_review.rb +20 -19
- data/lib/rails_best_practices/reviews/move_code_into_controller_review.rb +3 -3
- data/lib/rails_best_practices/reviews/move_code_into_helper_review.rb +5 -5
- data/lib/rails_best_practices/reviews/move_finder_to_named_scope_review.rb +5 -5
- data/lib/rails_best_practices/reviews/needless_deep_nesting_review.rb +13 -13
- data/lib/rails_best_practices/reviews/not_rescue_exception_review.rb +1 -1
- data/lib/rails_best_practices/reviews/not_use_default_route_review.rb +2 -2
- data/lib/rails_best_practices/reviews/not_use_time_ago_in_words_review.rb +1 -1
- data/lib/rails_best_practices/reviews/overuse_route_customizations_review.rb +3 -3
- data/lib/rails_best_practices/reviews/protect_mass_assignment_review.rb +32 -32
- data/lib/rails_best_practices/reviews/remove_empty_helpers_review.rb +4 -4
- data/lib/rails_best_practices/reviews/remove_unused_methods_in_controllers_review.rb +14 -14
- data/lib/rails_best_practices/reviews/remove_unused_methods_in_helpers_review.rb +6 -6
- data/lib/rails_best_practices/reviews/remove_unused_methods_in_models_review.rb +15 -15
- data/lib/rails_best_practices/reviews/replace_complex_creation_with_factory_method_review.rb +8 -8
- data/lib/rails_best_practices/reviews/restrict_auto_generated_routes_review.rb +71 -70
- data/lib/rails_best_practices/reviews/review.rb +2 -1
- data/lib/rails_best_practices/reviews/simplify_render_in_controllers_review.rb +1 -1
- data/lib/rails_best_practices/reviews/simplify_render_in_views_review.rb +11 -11
- data/lib/rails_best_practices/reviews/use_before_filter_review.rb +12 -9
- data/lib/rails_best_practices/reviews/use_model_association_review.rb +10 -10
- data/lib/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review.rb +14 -13
- data/lib/rails_best_practices/reviews/use_observer_review.rb +20 -20
- data/lib/rails_best_practices/reviews/use_parentheses_in_method_def_review.rb +6 -6
- data/lib/rails_best_practices/reviews/use_query_attribute_review.rb +44 -41
- data/lib/rails_best_practices/reviews/use_say_with_time_in_migrations_review.rb +7 -7
- data/lib/rails_best_practices/reviews/use_scope_access_review.rb +14 -14
- data/lib/rails_best_practices/reviews/use_turbo_sprockets_rails3_review.rb +1 -1
- data/lib/rails_best_practices/version.rb +1 -1
- data/rails_best_practices.gemspec +8 -8
- data/spec/rails_best_practices/analyzer_spec.rb +4 -4
- data/spec/rails_best_practices/core/error_spec.rb +6 -3
- data/spec/rails_best_practices/lexicals/long_line_check_spec.rb +21 -21
- data/spec/rails_best_practices/prepares/gemfile_prepare_spec.rb +15 -15
- data/spec/rails_best_practices/prepares/route_prepare_spec.rb +17 -15
- data/spec/rails_best_practices/reviews/hash_syntax_review_spec.rb +4 -4
- data/spec/rails_best_practices/reviews/law_of_demeter_review_spec.rb +8 -8
- data/spec/rails_best_practices/reviews/move_code_into_model_review_spec.rb +6 -6
- data/spec/rails_best_practices/reviews/protect_mass_assignment_review_spec.rb +4 -2
- data/spec/rails_best_practices/reviews/remove_unused_methods_in_controllers_review_spec.rb +6 -4
- data/spec/rails_best_practices/reviews/remove_unused_methods_in_helpers_review_spec.rb +8 -6
- data/spec/rails_best_practices/reviews/remove_unused_methods_in_models_review_spec.rb +16 -14
- data/spec/rails_best_practices/reviews/replace_instance_variable_with_local_variable_review_spec.rb +4 -4
- data/spec/rails_best_practices/reviews/use_multipart_alternative_as_content_type_of_email_review_spec.rb +14 -14
- data/spec/rails_best_practices/reviews/use_parentheses_in_method_def_review_spec.rb +1 -1
- data/spec/rails_best_practices/reviews/use_turbo_sprockets_rails3_review_spec.rb +51 -51
- metadata +5 -2
@@ -58,17 +58,17 @@ module RailsBestPractices
|
|
58
58
|
# check assignment node,
|
59
59
|
# if the right vavlue is a method_add_arg node with message "new",
|
60
60
|
# then remember the left value as new variable.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
end
|
61
|
+
def remember_new_variable(node)
|
62
|
+
right_value = node.right_value
|
63
|
+
if right_value.sexp_type == :method_add_arg && right_value.message.to_s == 'new'
|
64
|
+
@new_variables << node.left_value.to_s
|
66
65
|
end
|
66
|
+
end
|
67
67
|
|
68
68
|
# see if the receiver of the call node is included in the @new_varaibles.
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
def new_record?(node)
|
70
|
+
@new_variables.include? node.receiver.to_s
|
71
|
+
end
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -43,11 +43,11 @@ module RailsBestPractices
|
|
43
43
|
# and the receiver of the node should be with message :call (this is the other model),
|
44
44
|
# and any of its arguments is a hash,
|
45
45
|
# then it is the finder of other model.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
def other_finder?(node)
|
47
|
+
FINDERS.include?(node[1].message.to_s) &&
|
48
|
+
node[1].receiver.sexp_type == :call &&
|
49
|
+
node.arguments.grep_nodes_count(sexp_type: :bare_assoc_hash) > 0
|
50
|
+
end
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -28,7 +28,7 @@ module RailsBestPractices
|
|
28
28
|
# and the message of the receiver call node matchs one of the association name with the class name,
|
29
29
|
# then it violates the law of demeter.
|
30
30
|
add_callback :start_call do |node|
|
31
|
-
if
|
31
|
+
if node.receiver.sexp_type == :call && need_delegate?(node)
|
32
32
|
add_error 'law of demeter'
|
33
33
|
end
|
34
34
|
end
|
@@ -40,28 +40,29 @@ module RailsBestPractices
|
|
40
40
|
# if the receiver of receiver of the call node matchs any in model names,
|
41
41
|
# and the message of receiver of the call node matchs any in association names,
|
42
42
|
# then it needs delegate.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
43
|
+
def need_delegate?(node)
|
44
|
+
return unless variable(node)
|
45
|
+
|
46
|
+
class_name = variable(node).to_s.sub('@', '').classify
|
47
|
+
association_name = node.receiver.message.to_s
|
48
|
+
association = model_associations.get_association(class_name, association_name)
|
49
|
+
attribute_name = node.message.to_s
|
50
|
+
association && ASSOCIATION_METHODS.include?(association['meta']) &&
|
51
|
+
is_association_attribute?(association['class_name'], association_name, attribute_name)
|
52
|
+
end
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
end
|
54
|
+
def is_association_attribute?(association_class, association_name, attribute_name)
|
55
|
+
if association_name =~ /able$/
|
56
|
+
models.each do |class_name|
|
57
|
+
if model_associations.is_association?(class_name, association_name.sub(/able$/, '')) ||
|
58
|
+
model_associations.is_association?(class_name, association_name.sub(/able$/, 's'))
|
59
|
+
return true if model_attributes.is_attribute?(class_name, attribute_name)
|
60
60
|
end
|
61
|
-
else
|
62
|
-
model_attributes.is_attribute?(association_class, attribute_name)
|
63
61
|
end
|
62
|
+
else
|
63
|
+
model_attributes.is_attribute?(association_class, attribute_name)
|
64
64
|
end
|
65
|
+
end
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
@@ -38,9 +38,9 @@ module RailsBestPractices
|
|
38
38
|
private
|
39
39
|
|
40
40
|
# check if the node is a finder call node.
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
def finder?(node)
|
42
|
+
node.receiver.const? && FINDERS.include?(node.message.to_s)
|
43
|
+
end
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -43,11 +43,11 @@ module RailsBestPractices
|
|
43
43
|
# if the first argument is an array,
|
44
44
|
# and the size of array is greater than @array_count you defined,
|
45
45
|
# then it is complext.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
def complex_select_options?(node)
|
47
|
+
node[1].message.to_s == 'options_for_select' &&
|
48
|
+
node.arguments.all.first.sexp_type == :array &&
|
49
|
+
node.arguments.all.first.array_size > @array_count
|
50
|
+
end
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -35,11 +35,11 @@ module RailsBestPractices
|
|
35
35
|
# and the message of call method_add_arg is one of find, all, first or last,
|
36
36
|
# and any of its arguments is a hash,
|
37
37
|
# then it is a finder.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
def finder?(node)
|
39
|
+
FINDERS.include?(node[1].message.to_s) &&
|
40
|
+
node[1].sexp_type == :call &&
|
41
|
+
node.arguments.grep_nodes_count(sexp_type: :bare_assoc_hash) > 0
|
42
|
+
end
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -60,21 +60,21 @@ module RailsBestPractices
|
|
60
60
|
# and its message is resources or resource,
|
61
61
|
# then check if @counter is greater than or equal to @nested_count,
|
62
62
|
# if so, it is the needless deep nesting.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
73
|
-
@counter -= 1
|
74
|
-
elsif %i[command_call command].include?(node.sexp_type) && %w[resources resource].include?(node.message.to_s)
|
75
|
-
add_error "needless deep nesting (nested_count > #{@nested_count})", @file, node.line_number if @counter >= @nested_count && !@shallow_nodes.include?(node)
|
63
|
+
def recursively_check(node)
|
64
|
+
shallow = @shallow_nodes.include? node
|
65
|
+
if %i[command_call command].include?(node[1].sexp_type) && %w[resources resource].include?(node[1].message.to_s)
|
66
|
+
hash_node = node[1].arguments.grep_node(sexp_type: :bare_assoc_hash)
|
67
|
+
shallow ||= (hash_node && hash_node.hash_value('shallow').to_s == 'true')
|
68
|
+
@counter += 1
|
69
|
+
node.block_node.statements.each do |stmt_node|
|
70
|
+
@shallow_nodes << stmt_node if shallow
|
71
|
+
recursively_check(stmt_node)
|
76
72
|
end
|
73
|
+
@counter -= 1
|
74
|
+
elsif %i[command_call command].include?(node.sexp_type) && %w[resources resource].include?(node.message.to_s)
|
75
|
+
add_error "needless deep nesting (nested_count > #{@nested_count})", @file, node.line_number if @counter >= @nested_count && !@shallow_nodes.include?(node)
|
77
76
|
end
|
77
|
+
end
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
@@ -18,7 +18,7 @@ module RailsBestPractices
|
|
18
18
|
|
19
19
|
# check rescue node to see if its type is Exception
|
20
20
|
add_callback :start_rescue do |rescue_node|
|
21
|
-
if rescue_node.exception_classes.any? { |rescue_class| 'Exception'
|
21
|
+
if rescue_node.exception_classes.any? { |rescue_class| rescue_class.to_s == 'Exception' }
|
22
22
|
add_error "Don't rescue Exception", rescue_node.file, rescue_node.exception_classes.first.line_number
|
23
23
|
end
|
24
24
|
end
|
@@ -24,8 +24,8 @@ module RailsBestPractices
|
|
24
24
|
|
25
25
|
# check all command nodes
|
26
26
|
add_callback :start_command do |node|
|
27
|
-
if
|
28
|
-
|
27
|
+
if node.message.to_s == 'match' &&
|
28
|
+
node.arguments.all.first.to_s == ':controller(/:action(/:id(.:format)))'
|
29
29
|
add_error 'not use default route'
|
30
30
|
end
|
31
31
|
end
|
@@ -17,7 +17,7 @@ module RailsBestPractices
|
|
17
17
|
|
18
18
|
# check fcall node to see if its message is time_ago_in_words or distance_of_time_in_words_to_now
|
19
19
|
add_callback :start_fcall do |node|
|
20
|
-
if
|
20
|
+
if node.message.to_s == 'time_ago_in_words' || node.message.to_s == 'distance_of_time_in_words_to_now'
|
21
21
|
add_error 'not use time_ago_in_words'
|
22
22
|
end
|
23
23
|
end
|
@@ -46,9 +46,9 @@ module RailsBestPractices
|
|
46
46
|
# if its receiver is with message "resources",
|
47
47
|
# then calculate the count of call nodes, whose message is get, post, update or delete,
|
48
48
|
# it is just the count of member and collection custom routes.
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
def member_and_collection_count_for_rails3(node)
|
50
|
+
node[1].message.to_s == 'resources' ? node.grep_nodes_count(sexp_type: :command, message: VERBS) : 0
|
51
|
+
end
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -54,53 +54,53 @@ module RailsBestPractices
|
|
54
54
|
|
55
55
|
private
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
end
|
57
|
+
def check_activerecord_version
|
58
|
+
if Prepares.gems.gem_version('activerecord').to_i > 3
|
59
|
+
@mass_assignement = false
|
61
60
|
end
|
61
|
+
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
63
|
+
def check_whitelist_attributes_config
|
64
|
+
if Prepares.configs['config.active_record.whitelist_attributes'] == 'true'
|
65
|
+
@whitelist_attributes = true
|
67
66
|
end
|
67
|
+
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
69
|
+
def check_include_forbidden_attributes_protection_config
|
70
|
+
if Prepares.configs['railsbp.include_forbidden_attributes_protection'] == 'true'
|
71
|
+
@mass_assignement = false
|
73
72
|
end
|
73
|
+
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
75
|
+
def check_rails_builtin(node)
|
76
|
+
if @whitelist_attributes || [node.to_s, node.message.to_s].any? { |str| %w[attr_accessible attr_protected].include? str }
|
77
|
+
@mass_assignement = false
|
79
78
|
end
|
79
|
+
end
|
80
80
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
81
|
+
def check_strong_parameters(command_node)
|
82
|
+
if command_node.message.to_s == 'include' && command_node.arguments.all.first.to_s == 'ActiveModel::ForbiddenAttributesProtection'
|
83
|
+
@mass_assignement = false
|
85
84
|
end
|
85
|
+
end
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
87
|
+
def check_devise(command_node)
|
88
|
+
if command_node.message.to_s == 'devise'
|
89
|
+
@mass_assignement = false
|
91
90
|
end
|
91
|
+
end
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
end
|
93
|
+
def check_authlogic(node)
|
94
|
+
if [node.to_s, node.message.to_s].include? 'acts_as_authentic'
|
95
|
+
@mass_assignement = false
|
97
96
|
end
|
97
|
+
end
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
99
|
+
def check_active_record(const_path_ref_node)
|
100
|
+
if const_path_ref_node.base_class.to_s != 'ActiveRecord::Base'
|
101
|
+
@mass_assignement = false
|
103
102
|
end
|
103
|
+
end
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
@@ -17,16 +17,16 @@ module RailsBestPractices
|
|
17
17
|
|
18
18
|
# check the body of module node, if it is nil, then it should be removed.
|
19
19
|
add_callback :start_module do |module_node|
|
20
|
-
if
|
20
|
+
if module_node.module_name.to_s != 'ApplicationHelper' && empty_body?(module_node)
|
21
21
|
add_error 'remove empty helpers'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
protected
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
def empty_body?(module_node)
|
28
|
+
s(:bodystmt, s(:stmts_add, s(:stmts_new), s(:void_stmt)), nil, nil, nil) == module_node.body
|
29
|
+
end
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -71,7 +71,7 @@ module RailsBestPractices
|
|
71
71
|
node.arguments.all.each { |argument| mark_publicize(argument.to_s) }
|
72
72
|
when 'delegate'
|
73
73
|
last_argument = node.arguments.all.last
|
74
|
-
if
|
74
|
+
if last_argument.sexp_type == :bare_assoc_hash && last_argument.hash_value('to').to_s == 'controller'
|
75
75
|
controller_name = current_module_name.sub('Helper', 'Controller')
|
76
76
|
node.arguments.all[0..-2].each { |method| mark_publicize(method.to_s, controller_name) }
|
77
77
|
end
|
@@ -82,7 +82,7 @@ module RailsBestPractices
|
|
82
82
|
|
83
83
|
# mark assignment as used, like current_user = @user
|
84
84
|
add_callback :start_assign do |node|
|
85
|
-
if
|
85
|
+
if node.left_value.sexp_type == :var_field
|
86
86
|
call_method "#{node.left_value}=", current_class_name
|
87
87
|
end
|
88
88
|
end
|
@@ -90,7 +90,7 @@ module RailsBestPractices
|
|
90
90
|
# get all unused methods at the end of review process.
|
91
91
|
add_callback :after_check do
|
92
92
|
@routes.each do |route|
|
93
|
-
if '*'
|
93
|
+
if route.action_name == '*'
|
94
94
|
action_names = @controller_methods.get_methods(route.controller_name_with_namespaces).map(&:method_name)
|
95
95
|
action_names.each { |action_name| call_method(action_name, route.controller_name_with_namespaces) }
|
96
96
|
else
|
@@ -106,19 +106,19 @@ module RailsBestPractices
|
|
106
106
|
|
107
107
|
protected
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
109
|
+
def methods
|
110
|
+
@controller_methods
|
111
|
+
end
|
112
112
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
113
|
+
def internal_except_methods
|
114
|
+
%w[rescue_action default_url_options].map { |method_name| "*\##{method_name}" } +
|
115
|
+
%w[Devise::OmniauthCallbacksController].map { |controller_name| "#{controller_name}#*" }
|
116
|
+
end
|
117
117
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
118
|
+
def mark_publicize(method_name, class_name = current_class_name)
|
119
|
+
@controller_methods.mark_publicize(class_name, method_name)
|
120
|
+
@controller_methods.mark_parent_class_methods_publicize(class_name, method_name)
|
121
|
+
end
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
@@ -34,13 +34,13 @@ module RailsBestPractices
|
|
34
34
|
|
35
35
|
protected
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
def methods
|
38
|
+
@helper_methods
|
39
|
+
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
def internal_except_methods
|
42
|
+
['*#url_for']
|
43
|
+
end
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -88,22 +88,22 @@ module RailsBestPractices
|
|
88
88
|
|
89
89
|
protected
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
91
|
+
def methods
|
92
|
+
@model_methods
|
93
|
+
end
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
95
|
+
def internal_except_methods
|
96
|
+
%w[
|
97
|
+
initialize
|
98
|
+
validate validate_each validate_on_create validate_on_update
|
99
|
+
human_attribute_name assign_attributes attributes attribute
|
100
|
+
to_xml to_json as_json to_param
|
101
|
+
before_save before_create before_update before_destroy after_save after_create
|
102
|
+
after_update after_destroy after_find after_initialize
|
103
|
+
method_missing
|
104
|
+
table_name module_prefix
|
105
|
+
].map { |method_name| "*\##{method_name}" }
|
106
|
+
end
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|