@@ -9,19 +9,19 @@ def self.load_translations!
9
9
I18n . load_path << path . to_s
10
10
end
11
11
12
- # Let's have unique load_paths. Later entries in the I18n.load_path array take precendence
13
- # over earlier entries (e.g. lower array index means lower precedence). So we need to reverse
12
+ # Let's have unique load_paths. Later entries in the I18n.load_path array take precedence
13
+ # over earlier entries (e.g. lower array index means lower precedence). So we need to reverse
14
14
# the array, then call uniq (which will drop duplicates that show up later in the array).
15
- # Then reverse again. (You know, kind of like an Uno reverse battle.)
15
+ # Then reverse again. (You know, kind of like an Uno reverse battle.)
16
16
I18n . load_path = I18n . load_path . reverse . uniq . reverse
17
17
I18n . backend . reload!
18
18
end
19
19
20
20
initializer :append_migrations do |app |
21
- # only add the migrations if they are not already copied
21
+ # Only add the migrations if they are not already copied
22
22
# via the rake task. Allows gem to work both with the install:migrations
23
23
# and without it.
24
- if !app . root . to_s . match ( root . to_s ) &&
24
+ if !app . root . to_s . match ( HykuKnapsack :: Engine . root . to_s ) &&
25
25
app . root . join ( 'db/migrate' ) . children . none? { |path | path . fnmatch? ( "*.hyku_knapsack.rb" ) }
26
26
config . paths [ "db/migrate" ] . expanded . each do |expanded_path |
27
27
app . config . paths [ "db/migrate" ] << expanded_path
@@ -30,24 +30,27 @@ def self.load_translations!
30
30
end
31
31
32
32
config . before_initialize do
33
+ # Adding translation files to the load path
33
34
config . i18n . load_path += Dir [ "#{ config . root } /config/locales/**/*.yml" ]
34
35
36
+ # Setting up Devise parameters if the application has the user_devise_parameters method
35
37
if Hyku ::Application . respond_to? ( :user_devise_parameters= )
36
- Hyku ::Application . user_devise_parameters = [
37
- : database_authenticatable,
38
- : invitable,
39
- omniauth_providers : %i[ saml openid_connect cas ] ,
40
- : omniauthable,
41
- : recoverable,
42
- : registerable,
43
- : rememberable,
44
- : trackable,
45
- : validatable
46
- ]
38
+ Hyku ::Application . user_devise_parameters = {
39
+ database_authenticatable : { } ,
40
+ invitable : { } ,
41
+ omniauth_providers : [ : saml, : openid_connect, : cas] ,
42
+ omniauthable : { } ,
43
+ recoverable : { } ,
44
+ registerable : { } ,
45
+ rememberable : { } ,
46
+ trackable : { } ,
47
+ validatable : { }
48
+ }
47
49
end
48
50
end
49
51
50
52
config . after_initialize do
53
+ # Loading decorators for caching or dynamic evaluation depending on configuration
51
54
HykuKnapsack ::Engine . root . glob ( "app/**/*_decorator*.rb" ) . sort . each do |c |
52
55
Rails . configuration . cache_classes ? require ( c ) : load ( c )
53
56
end
@@ -62,7 +65,6 @@ def self.load_translations!
62
65
#
63
66
# https://github.com/scientist-softserv/adventist-dl/blob/97bd05946345926b2b6c706bd90e183a9d78e8ef/config/application.rb#L68-L73
64
67
Hyrax ::DerivativeService . services = [
65
- # Adventist::TextFileTextExtractionService,
66
68
IiifPrint ::PluggableDerivativeService
67
69
]
68
70
0 commit comments