Class: Orthoses::Rails::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/orthoses/rails/application.rb

Defined Under Namespace

Classes: Loader

Instance Method Summary collapse

Constructor Details

#initialize(loader) ⇒ Application

Returns a new instance of Application.



13
14
15
# File 'lib/orthoses/rails/application.rb', line 13

def initialize(loader)
  @loader = loader
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/orthoses/rails/application.rb', line 17

def call
  loader = @loader
  Orthoses::Builder.new do
    use Orthoses::ActionMailer::Base

    use Orthoses::ActiveModel::Attributes
    use Orthoses::ActiveModel::HasSecurePassword

    use Orthoses::ActiveRecord::BelongsTo
    use Orthoses::ActiveRecord::DelegatedType
    use Orthoses::ActiveRecord::Enum
    use Orthoses::ActiveRecord::GeneratedAttributeMethods
    use Orthoses::ActiveRecord::HasMany
    use Orthoses::ActiveRecord::HasOne
    use Orthoses::ActiveRecord::Persistence
    use Orthoses::ActiveRecord::Relation
    use Orthoses::ActiveRecord::Scope
    use Orthoses::ActiveRecord::SecureToken

    if defined?(::ActiveStorage)
      use Orthoses::ActiveStorage::Attached::Model
    end

    use Orthoses::ActiveSupport::Aliasing
    use Orthoses::ActiveSupport::ClassAttribute
    use Orthoses::ActiveSupport::Concern
    use Orthoses::ActiveSupport::Delegation
    use Orthoses::ActiveSupport::Configurable
    use Orthoses::ActiveSupport::MattrAccessor
    reset_runner loader
  end.call
end