@@ -80,16 +80,14 @@ A full example showing all options:
8080 # instead. This also affects what `logged_in_user` returns.
8181 user_as_object: 1
8282
83- # Optionally specify the sources of the data if not the
84- # defaults (as shown). See notes below for how these
85- # generate the resultset names. If you use standard DBIC
86- # resultset names, then these and the column names are the
87- # only settings you might need. The relationships between
83+ # Optionally specify the DBIC resultset names if you don't
84+ # use the defaults (as shown). These and the column names are the
85+ # only settings you might need. The relationships between
8886 # these resultsets is automatically introspected by
8987 # inspection of the schema.
90- users_source: 'user'
91- roles_source: 'role'
92- user_roles_source: 'user_role'
88+ users_resultset: User
89+ roles_resultset: Role
90+ user_roles_resultset: UserRole
9391
9492 # optionally set the column names
9593 users_username_column: username
@@ -127,23 +125,11 @@ A full example showing all options:
127125 # Optionally specify the algorithm when encrypting new passwords
128126 encryption_algorithm: SHA-512
129127
130- # If you don't use standard DBIC resultset names, you might
131- # need to configure these instead:
132- users_resultset: User
133- roles_resultset: Role
134- user_roles_resultset: UserRole
135-
136128 # Optional: To validate passwords using a method called
137129 # 'check_password' in users_resultset result class
138130 # which takes the password to check as a single argument:
139131 users_password_check: check_password
140132
141- # Deprecated settings. The following settings were renamed for clarity
142- # to the *_source settings
143- users_table:
144- roles_table:
145- user_roles_table:
146-
147133
148134=over
149135
@@ -163,20 +149,32 @@ sub BUILDARGS {
163149
164150 # backwards compat
165151
152+ # deprecate the *_source settings, but don't change anything yet
153+ deprecated_setting(' users_source' , ' users_resultset' )
154+ if $args {users_source };
155+
156+ deprecated_setting(' roles_source' , ' roles_resultset' )
157+ if $args {roles_source };
158+
159+ deprecated_setting(' user_roles_source' , ' user_roles_resultset' )
160+ if $args {user_roles_source };
161+
162+ # deprecate the *_table settings and move them into source, which
163+ # will be used in the lazy build for the correct *_resultset settings
166164 if ( $args {users_table } ) {
167- deprecated_setting( ' users_table' , ' users_source ' );
165+ deprecated_setting( ' users_table' , ' users_resultset ' );
168166 $args {users_source } = delete $args {users_table }
169167 if !$args {users_source };
170168 }
171169
172170 if ( $args {roles_table } ) {
173- deprecated_setting( ' roles_table' , ' roles_source ' );
171+ deprecated_setting( ' roles_table' , ' roles_resultset ' );
174172 $args {roles_source } = delete $args {roles_table }
175173 if !$args {roles_source };
176174 }
177175
178176 if ( $args {user_roles_table } ) {
179- deprecated_setting( ' user_roles_table' , ' user_roles_source ' );
177+ deprecated_setting( ' user_roles_table' , ' user_roles_resultset ' );
180178 $args {user_roles_source } = delete $args {user_roles_table }
181179 if !$args {user_roles_source };
182180 }
@@ -192,23 +190,26 @@ By default a row object is returned as a simple hash reference using
192190L<DBIx::Class::ResultClass::HashRefInflator> . Setting this to true
193191causes normal row objects to be returned instead.
194192
195- =item user_source
193+ =item users_resultset
196194
197- Specifies the source name that contains the users. This will be camelized to generate
198- the resultset name. The relationship to user_roles_source will be introspected from
199- the schema.
195+ Defaults to C<User > .
200196
201- =item role_source
197+ Specifies the L<DBIx::Class::ResultSet> that contains the users.
198+ The relationship to user_roles_source will be introspected from the schema.
202199
203- Specifies the source name that contains the roles. This will be camelized to generate
204- the resultset name. The relationship to user_roles_source will be introspected from
205- the schema.
200+ =item roles_resultset
206201
207- =item user_roles_source
202+ Defaults to C< Roles > .
208203
209- Specifies the source name that contains the user_roles joining table. This will be
210- camelized to generate the resultset name. The relationship to the user and role
211- source will be introspected from the schema.
204+ Specifies the L<DBIx::Class::ResultSet> that contains the roles.
205+ The relationship to user_roles_source will be introspected from the schema.
206+
207+ =item user_roles_resultset
208+
209+ Defaults to C<User > .
210+
211+ Specifies the L<DBIx::Class::ResultSet> that contains the user_roles joining table.
212+ The relationship to the user and role source will be introspected from the schema.
212213
213214=item users_username_column
214215
@@ -258,18 +259,38 @@ keyword. Instead it is intended to make it easier to access a user's roles if th
258259user hash is being passed around (without requiring access to the user_has_role
259260keyword in other modules).
260261
261- =item users_resultset
262+ =back
262263
263- =item roles_resultset
264+ =head1 DEPRECATED SETTINGS
264265
265- =item user_roles_resultset
266+ =over
266267
267- These configuration values are provided for fine-grain tuning of your DBIC
268- resultset names. If you use standard DBIC naming practices, you will not need
269- to configure these, and they will be generated internally automatically.
268+ =item user_source
269+
270+ =item user_table
271+
272+ Specifies the source name that contains the users. This will be camelized to generate
273+ the resultset name. The relationship to user_roles_source will be introspected from
274+ the schema.
275+
276+ =item role_source
277+
278+ =item role_table
279+
280+ Specifies the source name that contains the roles. This will be camelized to generate
281+ the resultset name. The relationship to user_roles_source will be introspected from
282+ the schema.
283+
284+ =item user_roles_source
285+
286+ =item user_roles_table
270287
271288=back
272289
290+ Specifies the source name that contains the user_roles joining table. This will be
291+ camelized to generate the resultset name. The relationship to the user and role
292+ source will be introspected from the schema.
293+
273294=head1 SUGGESTED SCHEMA
274295
275296If you use a schema similar to the examples provided here, you should need minimal
0 commit comments