Skip to content

Commit 72f4b7f

Browse files
committed
Fix for nothing happening on Puma
There is no need for thread-local-storage here as nothing writes to any of these members beyond setup. TLS members have a separate value for each thread. Setup only happens on one thread. This means these members are not properly set on all threads. indirect#223
1 parent 933507a commit 72f4b7f

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

lib/rails-footnotes.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
require 'rails-footnotes/extension'
99

1010
module Footnotes
11-
thread_mattr_accessor :before_hooks
12-
thread_mattr_accessor :after_hooks
13-
thread_mattr_accessor :enabled, default: false
11+
mattr_accessor :before_hooks
12+
mattr_accessor :after_hooks
13+
mattr_accessor :enabled, default: false
1414

1515
class << self
1616
delegate :notes, :to => Filter

lib/rails-footnotes/filter.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ class Filter
99
# :no_style => If you don't want the style to be appended to your pages
1010
# :prefix => Prefix appended to FootnotesLinks
1111
# :notes => Class variable that holds the notes to be processed
12-
thread_cattr_accessor :default_limit, default: 25
13-
thread_cattr_accessor :font_size, default: '11px'
14-
thread_cattr_accessor :lock_top_right, default: false
15-
thread_cattr_accessor :multiple_notes, default: false
16-
thread_cattr_accessor :no_style, default: false
17-
thread_cattr_accessor :prefix, default: 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d'
18-
thread_cattr_accessor :notes, default: [
12+
cattr_accessor :default_limit, default: 25
13+
cattr_accessor :font_size, default: '11px'
14+
cattr_accessor :lock_top_right, default: false
15+
cattr_accessor :multiple_notes, default: false
16+
cattr_accessor :no_style, default: false
17+
cattr_accessor :prefix, default: 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d'
18+
cattr_accessor :notes, default: [
1919
:assigns,
2020
:controller,
2121
:cookies,

lib/rails-footnotes/notes/assigns_note.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Footnotes
44
module Notes
55
class AssignsNote < AbstractNote
6-
thread_cattr_accessor :ignored_assigns, instance_writer: false, default: [
6+
cattr_accessor :ignored_assigns, instance_writer: false, default: [
77
:@real_format,
88
:@before_filter_chain_aborted,
99
:@performed_redirect,
@@ -18,7 +18,7 @@ class AssignsNote < AbstractNote
1818
:@view_runtime,
1919
:@marked_for_same_origin_verification
2020
]
21-
thread_cattr_accessor :ignored_assigns_pattern, instance_writer: false, default: /^@_/
21+
cattr_accessor :ignored_assigns_pattern, instance_writer: false, default: /^@_/
2222

2323
def initialize(controller)
2424
@controller = controller

lib/rails-footnotes/notes/log_note.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ class LogNote < AbstractNote
44

55
autoload :NoteLogger, 'rails-footnotes/notes/log_note/note_logger'
66

7-
thread_cattr_accessor :logs
8-
thread_cattr_accessor :original_logger
7+
cattr_accessor :logs
8+
cattr_accessor :original_logger
99

1010
def self.start!(controller)
1111
self.logs = []

lib/rails-footnotes/notes/partials_note.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Footnotes
22
module Notes
33
class PartialsNote < AbstractNote
44

5-
thread_cattr_accessor :partials
5+
cattr_accessor :partials
66

77
def self.start!(controller)
88
self.partials = []

lib/rails-footnotes/notes/queries_note.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module Footnotes
22
module Notes
33
class QueriesNote < AbstractNote
4-
thread_cattr_accessor :alert_db_time, default: 16.0, instance_writer: false
5-
thread_cattr_accessor :alert_sql_number, default: 8, instance_writer: false
6-
thread_cattr_accessor :orm, default: [:active_record, :data_mapper], instance_writer: false
7-
thread_cattr_accessor :ignored_regexps, default: [%r{(pg_table|pg_attribute|pg_namespace|show\stables|pragma|sqlite_master)}i], instance_writer: false
4+
cattr_accessor :alert_db_time, default: 16.0, instance_writer: false
5+
cattr_accessor :alert_sql_number, default: 8, instance_writer: false
6+
cattr_accessor :orm, default: [:active_record, :data_mapper], instance_writer: false
7+
cattr_accessor :ignored_regexps, default: [%r{(pg_table|pg_attribute|pg_namespace|show\stables|pragma|sqlite_master)}i], instance_writer: false
88

99
def self.start!(controller)
1010
self.query_subscriber.reset!

lib/rails-footnotes/notes/view_note.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Footnotes
22
module Notes
33
class ViewNote < AbstractNote
4-
thread_cattr_accessor :template
4+
cattr_accessor :template
55

66
def self.start!(controller)
77
@subscriber ||= ActiveSupport::Notifications.subscribe('render_template.action_view') do |*args|

0 commit comments

Comments
 (0)