pg_rails 7.0.8.pre.alpha.28 → 7.0.8.pre.alpha.29

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: c2090fbe898d25e227b13261a788564b15149cc5e732bd73609b9fa1ca7dd2f0
4
- data.tar.gz: 5024586aeba0ceaa65887565aa638762e70807e8db8518094b2f3f5085941902
3
+ metadata.gz: 693564c63bb61c878087db5c4acd52851378ba6a839004e97bd099291988f7e6
4
+ data.tar.gz: a709a829417768f1ab6c27e840396395920186e872f28a25063b13dd81027bd0
5
5
  SHA512:
6
- metadata.gz: 0b97d2de94a3db6ab66be03341ce2df03c1632fa7e13a7435619202a5f3cb0d71ffa537d30add4f997112d2680b87839d26bde254c997c46fd660a8abdae40ee
7
- data.tar.gz: 4cf0d683b00d0a3e548c823c16b273cb2e9e12206d8baf6b2b821f09f9a031b1eebadd37abf962297310ddc70fd2092fdab081a6acabf9bd7e3471aecb753c73
6
+ metadata.gz: '029e2473f5247d57ac72824aa2c95823dc5862b27e8341fc9e7f0e3124a3bc22634b6ad7ee6f5ebdb340643c8fc8c4f7a905ed92f3bb2502e2eb1c4b68233fd6'
7
+ data.tar.gz: 5bedfa1c3883599c2b67f99ed727804d0d9f97b852e4e8aa92c0e9778555e79e79aa6e0049e1e41dfb1ab0148fd10fc29a5c9182983caf75d735ebacdf5fa327
@@ -4,10 +4,7 @@ Rollbar.configure do |config|
4
4
 
5
5
  config.access_token = Rails.application.credentials.rollbar&.access_token_server
6
6
 
7
- # Here we'll disable in 'test':
8
- if Rails.env.local?
9
- config.enabled = false
10
- end
7
+ config.enabled = Rails.env.production? || ENV.fetch('FORCE_ROLLBAR', false)
11
8
 
12
9
  # By default, Rollbar will try to call the `current_user` controller method
13
10
  # to fetch the logged-in user object, and then call that object's `id`
@@ -75,4 +72,20 @@ Rollbar.configure do |config|
75
72
  # setup for Heroku. See:
76
73
  # https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
77
74
  config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env
75
+
76
+ # Este parámetro rollbar lo usa para los log files, pero yo lo uso también para filtrar
77
+ # el error reporting en before_process
78
+ config.logger_level = ENV.fetch('ROLLBAR_LOGGER_LEVEL', 'info').to_sym
79
+
80
+ config.before_process << Proc.new do |item|
81
+ acceptable_levels = begin
82
+ levels = [:debug, :info, :warn, :error]
83
+ if Rollbar.configuration.logger_level
84
+ levels[levels.find_index(Rollbar.configuration.logger_level)..-1]
85
+ else
86
+ []
87
+ end
88
+ end
89
+ acceptable_levels.include?(item[:level].to_sym) ? 'gogoogogooo' : 'ignored'
90
+ end
78
91
  end
@@ -9,29 +9,29 @@ import * as bootstrap from 'bootstrap'
9
9
 
10
10
  let rollbarToken = document.head.querySelector('meta[name=rollbar-token]')
11
11
  rollbarToken = rollbarToken && rollbarToken.content
12
- if (rollbarToken) {
13
- let rollbarEnv = document.head.querySelector('meta[name=rollbar-env]')
14
- rollbarEnv = rollbarEnv && rollbarEnv.content
15
- rollbarEnv = rollbarEnv || 'unknown'
16
12
 
17
- window.Rollbar = Rollbar
13
+ let rollbarEnv = document.head.querySelector('meta[name=rollbar-env]')
14
+ rollbarEnv = rollbarEnv && rollbarEnv.content
15
+ rollbarEnv = rollbarEnv || 'unknown'
18
16
 
19
- Rollbar.init()
17
+ window.Rollbar = Rollbar
20
18
 
21
- Rollbar.global({
22
- itemsPerMinute: 2,
23
- maxItems: 5
24
- })
25
- Rollbar.configure({
26
- accessToken: rollbarToken,
27
- captureUncaught: true,
28
- captureUnhandledRejections: true,
29
- reportLevel: 'warning',
30
- payload: {
31
- environment: rollbarEnv
32
- }
33
- })
34
- }
19
+ Rollbar.init()
20
+
21
+ Rollbar.global({
22
+ itemsPerMinute: 2,
23
+ maxItems: 5
24
+ })
25
+ Rollbar.configure({
26
+ enabled: !!rollbarToken,
27
+ accessToken: rollbarToken,
28
+ captureUncaught: true,
29
+ captureUnhandledRejections: true,
30
+ reportLevel: 'warning',
31
+ payload: {
32
+ environment: rollbarEnv
33
+ }
34
+ })
35
35
 
36
36
  document.addEventListener('turbo:load', bindToasts)
37
37
  document.addEventListener('turbo:render', bindToasts)
@@ -18,7 +18,8 @@ export default class extends Controller {
18
18
  console.error(notBaseErrors.dataset.errors)
19
19
  Rollbar.error(notBaseErrors.dataset.errors)
20
20
  const errorTitle = this.element.querySelector('.error-title')
21
- errorTitle.innerText = 'Lo lamentamos mucho pero ocurrió algo inesperado'
21
+ errorTitle.innerText = 'Lo lamentamos mucho pero ocurrió algo inesperado. Por favor, intentá nuevamente o ponete en contacto con nosotros.'
22
+ // FIXME: link a contacto
22
23
  }
23
24
  }
24
25
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.28'
4
+ VERSION = '7.0.8-alpha.29'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.28
4
+ version: 7.0.8.pre.alpha.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso