This repository was archived by the owner on May 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
app/controllers/open_invoice Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- open_invoice (0.1.0 )
4+ open_invoice (0.1.1 )
55 carrierwave-aws
66 jbuilder (~> 2.9 )
77 orm_adapter (~> 0.5.0 )
8080 ast (2.4.0 )
8181 aws-eventstream (1.0.3 )
8282 aws-partitions (1.263.0 )
83- aws-sdk-core (3.89.0 )
83+ aws-sdk-core (3.89.1 )
8484 aws-eventstream (~> 1.0 , >= 1.0.2 )
8585 aws-partitions (~> 1 , >= 1.239.0 )
8686 aws-sigv4 (~> 1.1 )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module OpenInvoice
44
55 # Author: varaby_m@modulotech.fr
66 # Root controller for OpenInvoice engine
7- class ApplicationController < :: ApplicationController
7+ class ApplicationController < OpenInvoice . config . controller_base_class
88
99 include ( ErrorHandling ) if OpenInvoice . config . catch_engine_errors
1010 include Authenticating
Original file line number Diff line number Diff line change 2222 secure_key : Secure key
2323 open_invoice/recipient :
2424 email : Email
25-
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ orm: active_record
22orm_base : ' ::ApplicationRecord'
33storage : :aws
44dir_prefix : uploads
5+ controller_base : ' ::ApplicationController'
56mailer_base : ' ::ApplicationMailer'
67mailer_layout : open_invoice/mailer
78raise_in_development : true
Original file line number Diff line number Diff line change @@ -141,6 +141,15 @@ def mailer_default_from
141141 SUPPORTED_CACHE_STORE = %i[ file_store mem_cache_store memory_store null_store
142142 redis_cache_store ] . freeze
143143
144+ # option to inherit base controller. defaults to "::ApplicationController"
145+ attr_accessor :controller_base
146+
147+ # controller class helper
148+ # @return [Class]
149+ def controller_base_class
150+ controller_base . constantize
151+ end
152+
144153 # option to allow errors slip through catchers and raise at the root level
145154 attr_accessor :raise_in_development
146155 # option to be the domain of the app "example.com"
Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ class Engine < ::Rails::Engine
1919 Mime ::Type . register 'application/pdf' , :pdf
2020 end
2121
22+ # add migrations to main app
23+ initializer :append_migrations do |app |
24+ unless app . root . to_s . match root . to_s
25+ config . paths [ 'db/migrate' ] . expanded . each do |expanded_path |
26+ app . config . paths [ 'db/migrate' ] << expanded_path
27+ end
28+ end
29+ end
30+
2231 end
2332
2433end
Original file line number Diff line number Diff line change 22
33module OpenInvoice
44
5- VERSION = '0.1.0 '
5+ VERSION = '0.1.1 '
66
77end
You can’t perform that action at this time.
0 commit comments