eac_rails_base0 0.38.1 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a640112c919c9a6822fe216b409ccca154016ea899670b9650a9a5ba7df5154
4
- data.tar.gz: 51fab398c2c39c8f647ec08eec774840eb8fbee3654aef9d2e3caa314f2d3008
3
+ metadata.gz: e4026b61a6fa5a4fd0012866b4a2255a7f5f65f7651f72b045a565f096d1cc63
4
+ data.tar.gz: a6cedd421494cfbb4bc4192fb7678a9175441791d728619b4bfa11c9235adc98
5
5
  SHA512:
6
- metadata.gz: e294db00be3e9c80991d6ac1615b3505dfdc0746b3d23bba19eef9d08f6af06d2bb99b01f4c20744c946644f2dc327bb5a38d7ae9201cac2e09d8d9b620141bb
7
- data.tar.gz: 40415fdbf162a74aec5493e1afa7a1dc1d0a2bb1905b8b981dae16bd7c58b5e00e19d6a6029daea8a83ae10a5dcffaa29c636b34d02a037c9aedf4cdb6015c28
6
+ metadata.gz: 18580bdecc9577a67c0f5003ff1da2318731a9d001c31d75675455ac51fbf94d59dacae3acab99a72e7d75357b470f6a30322680f0067b7a799e9b0164c8c3cd
7
+ data.tar.gz: 2d2b9fb4b544a1dc0da348564200b3a731e17ebff6b00fa81bd20c06d5648d14a9b68b3fa621eaaeb77fe50c7a8a7ccca2b923640d09904870094f7955005af0
@@ -23,6 +23,7 @@ module EacRailsBase0
23
23
  redirect_to main_app.root_url
24
24
  else
25
25
  flash[:danger] = 'Por favor faça o login.'
26
+ store_location_for(::EacUsersSupport::User, request.fullpath)
26
27
  redirect_to eac_users_support.new_user_session_path
27
28
  end
28
29
  end
@@ -34,5 +35,9 @@ module EacRailsBase0
34
35
  super
35
36
  end
36
37
  end
38
+
39
+ def after_sign_in_path_for(resource)
40
+ stored_location_for(resource) || root_path
41
+ end
37
42
  end
38
43
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacRailsBase0
4
+ class ApplicationRecord < ActiveRecord::Base
5
+ self.abstract_class = true
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ <% if current_user&.administrator %>
2
+ <div class="text-center"><b>Versão:</b> <%= base0_app_version %></div>
3
+ <% end %>
@@ -33,5 +33,6 @@
33
33
  <%= render partial: '/layouts/eac_rails_base0/flash' %>
34
34
  <%= yield %>
35
35
  </div>
36
+ <%= render partial: '/layouts/eac_rails_base0/version' %>
36
37
  </body>
37
38
  </html>
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'carrierwave'
4
+ require 'carrierwave/orm/activerecord'
4
5
  require 'fog/aws'
5
6
 
6
7
  if ENV['carrierwave_provider'] == 'AWS'
@@ -2,4 +2,4 @@
2
2
 
3
3
  # Be sure to restart your server when you modify this file.
4
4
 
5
- Rails.application.config.action_dispatch.cookies_serializer = :json
5
+ Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ if ::Rails.env.development?
4
+ require 'letter_opener'
5
+ ::Rails.application.config.action_mailer.delivery_method = :letter_opener
6
+ ::Rails.application.config.action_mailer.perform_deliveries = true
7
+ end
@@ -32,7 +32,7 @@ module EacRailsBase0App
32
32
  config.i18n.default_locale = :'pt-BR'
33
33
 
34
34
  # Do not swallow errors in after_commit/after_rollback callbacks.
35
- config.active_record.raise_in_transactional_callbacks = true
35
+ config.active_record.raise_in_transactional_callbacks = true if ::Rails.version < '5'
36
36
 
37
37
  # Autoload do código em /lib.
38
38
  config.autoload_paths << Rails.root.join('lib')
@@ -5,23 +5,21 @@ module EacRailsBase0
5
5
  module EacRailsUtilsLinksHelper
6
6
  class << self
7
7
  def included(base)
8
- base.include(InstanceMethods)
9
- base.include(::CanCanDryHelper)
10
- base.alias_method_chain :short_object_link, :base0
11
- base.alias_method_chain :object_path_by_class, :base0
8
+ base.prepend(InstanceMethods)
9
+ base.prepend(::CanCanDryHelper)
12
10
  end
13
11
  end
14
12
 
15
13
  module InstanceMethods
16
- def short_object_link_with_base0(object, action = nil, options = {})
14
+ def short_object_link(object, action = nil, options = {})
17
15
  value_or_sign(object, '') do |value|
18
16
  path = object_path(value, action)
19
17
  link_to '', url_for(path), options if can_by_path?(path, options[:method])
20
18
  end
21
19
  end
22
20
 
23
- def object_path_by_class_with_base0(*args)
24
- object_path_by_class_without_base0(*args).gsub(/_url\z/, '_path')
21
+ def object_path_by_class(*args)
22
+ super(*args).gsub(/_url\z/, '_path')
25
23
  end
26
24
  end
27
25
  end
@@ -31,4 +29,4 @@ end
31
29
  require 'eac_rails_utils/links_helper'
32
30
  patch = ::EacRailsBase0::Patches::EacRailsUtilsLinksHelper
33
31
  target = ::EacRailsUtils::LinksHelper
34
- target.send(:include, patch) unless target.included_modules.include?(patch)
32
+ target.prepend(patch) unless target.included_modules.include?(patch)
@@ -5,14 +5,13 @@ module EacRailsBase0
5
5
  module UrlForPatch
6
6
  class << self
7
7
  def included(base)
8
- base.include(InstanceMethods)
9
- base.alias_method_chain :url_for, :engines
8
+ base.prepend(InstanceMethods)
10
9
  end
11
10
  end
12
11
 
13
12
  module InstanceMethods
14
- def url_for_with_engines(options = nil)
15
- url_for_without_engines(options)
13
+ def url_for(options = nil)
14
+ super(options)
16
15
  rescue ActionController::UrlGenerationError
17
16
  engines_url_for(options)
18
17
  end
@@ -39,4 +38,4 @@ end
39
38
 
40
39
  patch = ::EacRailsBase0::Patches::UrlForPatch
41
40
  target = ::ActionDispatch::Routing::UrlFor
42
- target.send(:include, patch) unless target.included_modules.include?(patch)
41
+ target.prepend(patch) unless target.included_modules.include?(patch)
@@ -1,20 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file was generated by the `rails generate rspec:install` command. Conventionally, all
4
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
- # The generated `.rspec` file contains `--require spec_helper` which will cause
6
- # this file to always be loaded, without a need to explicitly require it in any
7
- # files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need
15
- # it.
16
- #
17
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
18
3
  begin
19
4
  ActiveRecord::Migration.maintain_test_schema!
20
5
  rescue ActiveRecord::PendingMigrationError => e
@@ -23,114 +8,22 @@ rescue ActiveRecord::PendingMigrationError => e
23
8
  end
24
9
 
25
10
  RSpec.configure do |config|
26
- # rspec-expectations config goes here. You can use an alternate
27
- # assertion/expectation library such as wrong or the stdlib/minitest
28
- # assertions if you prefer.
29
11
  config.expect_with :rspec do |expectations|
30
- # This option will default to `true` in RSpec 4. It makes the `description`
31
- # and `failure_message` of custom matchers include text for helper methods
32
- # defined using `chain`, e.g.:
33
- # be_bigger_than(2).and_smaller_than(4).description
34
- # # => "be bigger than 2 and smaller than 4"
35
- # ...rather than:
36
- # # => "be bigger than 2"
37
12
  expectations.include_chain_clauses_in_custom_matcher_descriptions = true
38
13
  end
39
14
 
40
- # rspec-mocks config goes here. You can use an alternate test double
41
- # library (such as bogus or mocha) by changing the `mock_with` option here.
42
15
  config.mock_with :rspec do |mocks|
43
- # Prevents you from mocking or stubbing a method that does not exist on
44
- # a real object. This is generally recommended, and will default to
45
- # `true` in RSpec 4.
46
16
  mocks.verify_partial_doubles = true
47
17
  end
48
18
 
49
- # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
50
- # have no way to turn it off -- the option exists only for backwards
51
- # compatibility in RSpec 3). It causes shared context metadata to be
52
- # inherited by the metadata hash of host groups and examples, rather than
53
- # triggering implicit auto-inclusion in groups with matching metadata.
54
19
  config.shared_context_metadata_behavior = :apply_to_host_groups
55
-
56
- # The settings below are suggested to provide a good initial experience
57
- # with RSpec, but feel free to customize to your heart's content.
58
- # # This allows you to limit a spec run to individual examples or groups
59
- # # you care about by tagging them with `:focus` metadata. When nothing
60
- # # is tagged with `:focus`, all examples get run. RSpec also provides
61
- # # aliases for `it`, `describe`, and `context` that include `:focus`
62
- # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
63
- # config.filter_run_when_matching :focus
64
- #
65
- # # Allows RSpec to persist some state between runs in order to support
66
- # # the `--only-failures` and `--next-failure` CLI options. We recommend
67
- # # you configure your source control system to ignore this file.
68
20
  config.example_status_persistence_file_path = ::Rails.root.join('tmp', 'cache', 'rspec.txt')
69
- #
70
- # # Limits the available syntax to the non-monkey patched syntax that is
71
- # # recommended. For more details, see:
72
- # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
73
- # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
74
- # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
75
- # config.disable_monkey_patching!
76
- #
77
- # # Many RSpec users commonly either run the entire suite or an individual
78
- # # file, and it's useful to allow more verbose output when running an
79
- # # individual spec file.
80
- # if config.files_to_run.one?
81
- # # Use the documentation formatter for detailed output,
82
- # # unless a formatter has already been configured
83
- # # (e.g. via a command-line flag).
84
- # config.default_formatter = "doc"
85
- # end
86
- #
87
- # # Print the 10 slowest examples and example groups at the
88
- # # end of the spec run, to help surface which specs are running
89
- # # particularly slow.
90
- # config.profile_examples = 10
91
- #
92
- # # Run specs in random order to surface order dependencies. If you find an
93
- # # order dependency and want to debug it, you can fix the order by providing
94
- # # the seed, which is printed after each run.
95
- # # --seed 1234
96
- # config.order = :random
97
- #
98
- # # Seed global randomization in this process using the `--seed` CLI option.
99
- # # Setting this allows you to use `--seed` to deterministically reproduce
100
- # # test failures related to randomization by passing the same `--seed` value
101
- # # as the one that triggered the failure.
102
- # Kernel.srand config.seed
103
-
104
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
105
21
  config.fixture_path = "#{::Rails.root}/spec/fixtures"
106
-
107
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
108
- # examples within a transaction, remove the following line or assign false
109
- # instead of true.
110
22
  config.use_transactional_fixtures = true
111
-
112
- # RSpec Rails can automatically mix in different behaviours to your tests
113
- # based on their file location, for example enabling you to call `get` and
114
- # `post` in specs under `spec/controllers`.
115
- #
116
- # You can disable this behaviour by removing the line below, and instead
117
- # explicitly tag your specs with their type, e.g.:
118
- #
119
- # RSpec.describe UsersController, :type => :controller do
120
- # # ...
121
- # end
122
- #
123
- # The different available types are documented in the features, such as in
124
- # https://relishapp.com/rspec/rspec-rails/docs
125
23
  config.infer_spec_type_from_file_location!
126
-
127
- # Filter lines from Rails gems in backtraces.
128
24
  config.filter_rails_from_backtrace!
129
- # arbitrary gems may also be filtered via:
130
- # config.filter_gems_from_backtrace("gem name")
131
25
  end
132
26
 
133
- require 'eac_rails_base0/spec_helper/capybara'
134
- require 'eac_rails_base0/spec_helper/factory_bot'
135
- require 'eac_rails_base0/spec_helper/eac_users_support'
27
+ require 'eac_ruby_utils/require_sub'
28
+ ::EacRubyUtils.require_sub __FILE__
136
29
  require 'aranha/parsers/spec/source_target_fixtures_example'
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'devise'
4
+ require_relative 'factory_bot'
4
5
 
5
6
  RSpec.configure do |config|
6
7
  config.include Warden::Test::Helpers
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.38.1'
4
+ VERSION = '0.41.0'
5
5
  end
@@ -1 +1 @@
1
- --require lib/spec_rails_helper --color --format doc --default-path . --pattern '**/spec/**/*_spec.rb'
1
+ --require lib/spec_rails_helper --color --format doc --default-path . --pattern 'spec/**/*_spec.rb'
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_rails_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.38.1
4
+ version: 0.41.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-26 00:00:00.000000000 Z
11
+ date: 2020-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: active_scaffold
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.5'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.5.5
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.5'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.5.5
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: aranha
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -130,16 +150,16 @@ dependencies:
130
150
  name: coffee-rails
131
151
  requirement: !ruby/object:Gem::Requirement
132
152
  requirements:
133
- - - "~>"
153
+ - - ">="
134
154
  - !ruby/object:Gem::Version
135
- version: 4.1.0
155
+ version: 4.2.2
136
156
  type: :runtime
137
157
  prerelease: false
138
158
  version_requirements: !ruby/object:Gem::Requirement
139
159
  requirements:
140
- - - "~>"
160
+ - - ">="
141
161
  - !ruby/object:Gem::Version
142
- version: 4.1.0
162
+ version: 4.2.2
143
163
  - !ruby/object:Gem::Dependency
144
164
  name: eac_rails_utils
145
165
  requirement: !ruby/object:Gem::Requirement
@@ -180,14 +200,20 @@ dependencies:
180
200
  requirements:
181
201
  - - "~>"
182
202
  - !ruby/object:Gem::Version
183
- version: '0.4'
203
+ version: '0.6'
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: 0.6.3
184
207
  type: :runtime
185
208
  prerelease: false
186
209
  version_requirements: !ruby/object:Gem::Requirement
187
210
  requirements:
188
211
  - - "~>"
189
212
  - !ruby/object:Gem::Version
190
- version: '0.4'
213
+ version: '0.6'
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: 0.6.3
191
217
  - !ruby/object:Gem::Dependency
192
218
  name: eac_ruby_utils
193
219
  requirement: !ruby/object:Gem::Requirement
@@ -208,20 +234,20 @@ dependencies:
208
234
  requirements:
209
235
  - - "~>"
210
236
  - !ruby/object:Gem::Version
211
- version: '0.6'
237
+ version: '0.8'
212
238
  - - ">="
213
239
  - !ruby/object:Gem::Version
214
- version: 0.6.1
240
+ version: 0.8.2
215
241
  type: :runtime
216
242
  prerelease: false
217
243
  version_requirements: !ruby/object:Gem::Requirement
218
244
  requirements:
219
245
  - - "~>"
220
246
  - !ruby/object:Gem::Version
221
- version: '0.6'
247
+ version: '0.8'
222
248
  - - ">="
223
249
  - !ruby/object:Gem::Version
224
- version: 0.6.1
250
+ version: 0.8.2
225
251
  - !ruby/object:Gem::Dependency
226
252
  name: factory_bot_rails
227
253
  requirement: !ruby/object:Gem::Requirement
@@ -312,6 +338,20 @@ dependencies:
312
338
  - - ">="
313
339
  - !ruby/object:Gem::Version
314
340
  version: '0'
341
+ - !ruby/object:Gem::Dependency
342
+ name: letter_opener
343
+ requirement: !ruby/object:Gem::Requirement
344
+ requirements:
345
+ - - ">="
346
+ - !ruby/object:Gem::Version
347
+ version: '0'
348
+ type: :runtime
349
+ prerelease: false
350
+ version_requirements: !ruby/object:Gem::Requirement
351
+ requirements:
352
+ - - ">="
353
+ - !ruby/object:Gem::Version
354
+ version: '0'
315
355
  - !ruby/object:Gem::Dependency
316
356
  name: puma
317
357
  requirement: !ruby/object:Gem::Requirement
@@ -330,22 +370,16 @@ dependencies:
330
370
  name: rails
331
371
  requirement: !ruby/object:Gem::Requirement
332
372
  requirements:
333
- - - "~>"
334
- - !ruby/object:Gem::Version
335
- version: 4.2.11
336
373
  - - ">="
337
374
  - !ruby/object:Gem::Version
338
- version: 4.2.11.1
375
+ version: 4.2.11.3
339
376
  type: :runtime
340
377
  prerelease: false
341
378
  version_requirements: !ruby/object:Gem::Requirement
342
379
  requirements:
343
- - - "~>"
344
- - !ruby/object:Gem::Version
345
- version: 4.2.11
346
380
  - - ">="
347
381
  - !ruby/object:Gem::Version
348
- version: 4.2.11.1
382
+ version: 4.2.11.3
349
383
  - !ruby/object:Gem::Dependency
350
384
  name: rails-i18n
351
385
  requirement: !ruby/object:Gem::Requirement
@@ -360,6 +394,20 @@ dependencies:
360
394
  - - "~>"
361
395
  - !ruby/object:Gem::Version
362
396
  version: '4.0'
397
+ - !ruby/object:Gem::Dependency
398
+ name: recordselect
399
+ requirement: !ruby/object:Gem::Requirement
400
+ requirements:
401
+ - - ">="
402
+ - !ruby/object:Gem::Version
403
+ version: 3.10.1
404
+ type: :runtime
405
+ prerelease: false
406
+ version_requirements: !ruby/object:Gem::Requirement
407
+ requirements:
408
+ - - ">="
409
+ - !ruby/object:Gem::Version
410
+ version: 3.10.1
363
411
  - !ruby/object:Gem::Dependency
364
412
  name: rspec-rails
365
413
  requirement: !ruby/object:Gem::Requirement
@@ -518,6 +566,7 @@ files:
518
566
  - app/helpers/eac_rails_base0/app_version_helper.rb
519
567
  - app/helpers/eac_rails_base0/layout_helper.rb
520
568
  - app/helpers/eac_rails_base0/panel_default_helper.rb
569
+ - app/models/eac_rails_base0/application_record.rb
521
570
  - app/uploaders/eac_rails_base0/default_file_uploader.rb
522
571
  - app/views/devise/confirmations/new.html.erb
523
572
  - app/views/devise/mailer/confirmation_instructions.html.erb
@@ -533,6 +582,7 @@ files:
533
582
  - app/views/layouts/eac_rails_base0/_navbar_user.html.erb
534
583
  - app/views/layouts/eac_rails_base0/_open_graph_protocol.html.erb
535
584
  - app/views/layouts/eac_rails_base0/_tasks_scheduler_alert.html.erb
585
+ - app/views/layouts/eac_rails_base0/_version.erb
536
586
  - app/views/layouts/eac_rails_base0/application.html.erb
537
587
  - config/initializers/action_mailer.rb
538
588
  - config/initializers/active_scaffold.rb
@@ -541,6 +591,7 @@ files:
541
591
  - config/initializers/carrier_wave.rb
542
592
  - config/initializers/cookies_serializer.rb
543
593
  - config/initializers/filter_parameter_logging.rb
594
+ - config/initializers/letter_opener.rb
544
595
  - config/initializers/mime_types.rb
545
596
  - config/initializers/patches.rb
546
597
  - config/initializers/pg_deprecated_constants.rb
@@ -621,7 +672,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
621
672
  - !ruby/object:Gem::Version
622
673
  version: '0'
623
674
  requirements: []
624
- rubygems_version: 3.0.6
675
+ rubygems_version: 3.0.8
625
676
  signing_key:
626
677
  specification_version: 4
627
678
  summary: A Rails base for multiple Rails projects developed by Esquilo Azul Company.