pg_rails 7.0.8.pre.alpha.28 → 7.0.8.pre.alpha.30

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: b05880ae4efef4a5609afd7b2e722d1080f34975dfc30fba718c315288183c42
4
+ data.tar.gz: 77ada8099f446b1f700a2d658e426ac2579302f751e282f133a0dcb77b279815
5
5
  SHA512:
6
- metadata.gz: 0b97d2de94a3db6ab66be03341ce2df03c1632fa7e13a7435619202a5f3cb0d71ffa537d30add4f997112d2680b87839d26bde254c997c46fd660a8abdae40ee
7
- data.tar.gz: 4cf0d683b00d0a3e548c823c16b273cb2e9e12206d8baf6b2b821f09f9a031b1eebadd37abf962297310ddc70fd2092fdab081a6acabf9bd7e3471aecb753c73
6
+ metadata.gz: 67e2e272267f0f12ddf35a17ab95d49043969ce4f4ccfb193c8640906ebe14eba6385778f6794523ed07f9cc0e86d8f24f51a43bad514580139c62dffdf42d5d
7
+ data.tar.gz: b46640f9d513ce67fa3519fa4c30928b4743d5e0fda32988b5c3568a4f85902d87a404bcc99effbe900a06bdbc8c9856a7c2074934b82f08ba49c071de563cc7
@@ -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,6 +1,6 @@
1
1
  require "#{__dir__}/../../pg_engine/lib/pg_engine"
2
2
  require "#{__dir__}/../../pg_associable/lib/pg_associable"
3
- require "#{__dir__}/../../pg_scaffold/lib/pg_scaffold"
3
+ require "#{__dir__}/../../pg_scaffold/lib/pg_scaffold" if Rails.env.local?
4
4
  require "#{__dir__}/../../pg_layout/lib/pg_layout"
5
5
 
6
6
  module PgRails
@@ -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.30'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-08 00:00:00.000000000 Z
11
+ date: 2024-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails