@@ -9,19 +9,19 @@ def self.load_translations!
99 I18n . load_path << path . to_s
1010 end
1111
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
1414 # 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.)
1616 I18n . load_path = I18n . load_path . reverse . uniq . reverse
1717 I18n . backend . reload!
1818 end
1919
2020 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
2222 # via the rake task. Allows gem to work both with the install:migrations
2323 # 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 ) &&
2525 app . root . join ( 'db/migrate' ) . children . none? { |path | path . fnmatch? ( "*.hyku_knapsack.rb" ) }
2626 config . paths [ "db/migrate" ] . expanded . each do |expanded_path |
2727 app . config . paths [ "db/migrate" ] << expanded_path
@@ -30,24 +30,27 @@ def self.load_translations!
3030 end
3131
3232 config . before_initialize do
33+ # Adding translation files to the load path
3334 config . i18n . load_path += Dir [ "#{ config . root } /config/locales/**/*.yml" ]
3435
36+ # Setting up Devise parameters if the application has the user_devise_parameters method
3537 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+ }
4749 end
4850 end
4951
5052 config . after_initialize do
53+ # Loading decorators for caching or dynamic evaluation depending on configuration
5154 HykuKnapsack ::Engine . root . glob ( "app/**/*_decorator*.rb" ) . sort . each do |c |
5255 Rails . configuration . cache_classes ? require ( c ) : load ( c )
5356 end
@@ -62,7 +65,6 @@ def self.load_translations!
6265 #
6366 # https://github.com/scientist-softserv/adventist-dl/blob/97bd05946345926b2b6c706bd90e183a9d78e8ef/config/application.rb#L68-L73
6467 Hyrax ::DerivativeService . services = [
65- # Adventist::TextFileTextExtractionService,
6668 IiifPrint ::PluggableDerivativeService
6769 ]
6870
0 commit comments