alchemy_cms 4.6.6 → 4.6.7

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: cba5724f523be0da026405c616379badba8f6bc12dd5cd3b3ed8ce380031a580
4
- data.tar.gz: 06ceccfb73194bb322fe13a09284d890602e03ce7702e170efcde7075cb3babf
3
+ metadata.gz: ca89899748d18f70ee78b29698acf1bf9a768a938ef9bc6b95183eda42fb0e7b
4
+ data.tar.gz: e8fcc703a6dce815bea12d6af8f9e0307fcf38589a41fb12b96fe223ce09c793
5
5
  SHA512:
6
- metadata.gz: 1743906a75c14ad90b5dc3ae38c9ab58fbbaf7a58b482c7a97a56b991f7f4df31af25dbef02df6ca72d2e8fdacc9f8743ecfc0b92dbdedfb15c41e1054dd6590
7
- data.tar.gz: 3e1106629ffc7dc3c41f3e186a21546a9cc3b1fd7d8fb8f5a2a4590f64498e347bb9caf176f695f98c76a9cdd32bc9d2118c43d8843ffcf0465ce846a25e8e87
6
+ metadata.gz: 6f653e26248ed2a01b92fcc6b7ded6b4eac3e057b25ad84830a6ba2ca3fa3df8c1d1af722c281bcb89ab273f4a07f5556822e0e27b40ca89d2057a4a9337e174
7
+ data.tar.gz: 96404109c54eb6c3c12e46bcc925725ccd352041437f895359f8b11e4b10abe93abd039e040868b0bbf5a5716865bcbbcc0662c3e20fd4d5ce636e8a0c5aa465
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 4.6.7 (2022-01-23)
2
+
3
+ - fix(CellsMigration): Do not autogenerate nested elements
4
+ - make the admin error tracker customizable
5
+
1
6
  ## 4.6.6 (2021-11-24)
2
7
 
3
8
  - Give overlay picture spec more time to load images
@@ -42,9 +42,7 @@ module Alchemy
42
42
  def exception_handler(error)
43
43
  exception_logger(error)
44
44
  show_error_notice(error)
45
- if defined?(Airbrake)
46
- notify_airbrake(error) unless Rails.env.development? || Rails.env.test?
47
- end
45
+ notify_error_tracker(error)
48
46
  end
49
47
 
50
48
  # Displays an error notice in the Alchemy backend.
@@ -167,6 +165,14 @@ module Alchemy
167
165
  site
168
166
  end
169
167
  end
168
+
169
+ def notify_error_tracker(exception)
170
+ if ::Alchemy::ErrorTracking.notification_handler.respond_to?(:call)
171
+ ::Alchemy::ErrorTracking.notification_handler.call(exception)
172
+ else
173
+ Rails.logger.warn("To use the Alchemy::ErrorTracking.notification_handler, it must respond to #call.")
174
+ end
175
+ end
170
176
  end
171
177
  end
172
178
  end
@@ -28,5 +28,12 @@ module Alchemy
28
28
  config.after_initialize do
29
29
  require_relative './userstamp'
30
30
  end
31
+
32
+ initializer "alchemy.error_tracking" do
33
+ if defined?(Airbrake)
34
+ require_relative "error_tracking/airbrake_handler"
35
+ Alchemy::ErrorTracking.notification_handler = Alchemy::ErrorTracking::AirbrakeHandler
36
+ end
37
+ end
31
38
  end
32
39
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module ErrorTracking
5
+ class AirbrakeHandler < BaseHandler
6
+ def self.call(exception)
7
+ return if ["development", "test"].include?(Rails.env)
8
+
9
+ notify_airbrake(exception)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module ErrorTracking
5
+ class BaseHandler
6
+ def self.call(exception)
7
+ # implement your own notification method
8
+ end
9
+ end
10
+
11
+ mattr_accessor :notification_handler
12
+ @@notification_handler = BaseHandler
13
+ end
14
+ end
@@ -31,6 +31,7 @@ module Alchemy::Upgrader::Tasks
31
31
  elements = Alchemy::Element.where(cell_id: cell.id).order(position: :asc)
32
32
 
33
33
  if fixed_element.new_record?
34
+ fixed_element.autogenerate_nested_elements = false
34
35
  fixed_element.save!
35
36
  Alchemy::Element.acts_as_list_no_update do
36
37
  elements.update_all(parent_element_id: fixed_element.id)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "4.6.6"
4
+ VERSION = "4.6.7"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/lib/alchemy_cms.rb CHANGED
@@ -35,6 +35,7 @@ require_relative 'alchemy/configuration_methods'
35
35
  require_relative 'alchemy/controller_actions'
36
36
  require_relative 'alchemy/deprecation'
37
37
  require_relative 'alchemy/elements_finder'
38
+ require_relative 'alchemy/error_tracking'
38
39
  require_relative 'alchemy/errors'
39
40
  require_relative 'alchemy/essence'
40
41
  require_relative 'alchemy/filetypes'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.6
4
+ version: 4.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2021-11-24 00:00:00.000000000 Z
16
+ date: 2022-01-23 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: active_model_serializers
@@ -1056,6 +1056,8 @@ files:
1056
1056
  - lib/alchemy/deprecation.rb
1057
1057
  - lib/alchemy/elements_finder.rb
1058
1058
  - lib/alchemy/engine.rb
1059
+ - lib/alchemy/error_tracking.rb
1060
+ - lib/alchemy/error_tracking/airbrake_handler.rb
1059
1061
  - lib/alchemy/errors.rb
1060
1062
  - lib/alchemy/essence.rb
1061
1063
  - lib/alchemy/filetypes.rb