@@ -28,13 +28,17 @@ class Setup
28
28
# @api private
29
29
attr_reader :notifications
30
30
31
+ # @api private
32
+ attr_accessor :inflector
33
+
31
34
# @api private
32
35
def initialize ( notifications )
33
36
@relation_classes = [ ]
34
37
@command_classes = [ ]
35
38
@mapper_classes = [ ]
36
39
@plugins = [ ]
37
40
@notifications = notifications
41
+ @inflector = Inflector
38
42
end
39
43
40
44
# Enable auto-registration for a given setup object
@@ -47,7 +51,7 @@ def initialize(notifications)
47
51
#
48
52
# @api public
49
53
def auto_registration ( directory , **options )
50
- auto_registration = AutoRegistration . new ( directory , **options )
54
+ auto_registration = AutoRegistration . new ( directory , inflector : inflector , **options )
51
55
auto_registration . relations . map { |r | register_relation ( r ) }
52
56
auto_registration . commands . map { |r | register_command ( r ) }
53
57
auto_registration . mappers . map { |r | register_mapper ( r ) }
@@ -58,21 +62,21 @@ def auto_registration(directory, **options)
58
62
#
59
63
# @api private
60
64
def register_relation ( *klasses )
61
- klasses . reduce ( @relation_classes , :<< )
65
+ @relation_classes . concat ( klasses )
62
66
end
63
67
64
68
# Mapper sub-classes are being registered with this method during setup
65
69
#
66
70
# @api private
67
71
def register_mapper ( *klasses )
68
- klasses . reduce ( @mapper_classes , :<< )
72
+ @mapper_classes . concat ( klasses )
69
73
end
70
74
71
75
# Command sub-classes are being registered with this method during setup
72
76
#
73
77
# @api private
74
78
def register_command ( *klasses )
75
- klasses . reduce ( @command_classes , :<< )
79
+ @command_classes . concat ( klasses )
76
80
end
77
81
78
82
# @api private
0 commit comments