Class: TenantCheck::Notification
- Inherits:
-
Object
- Object
- TenantCheck::Notification
- Defined in:
- lib/tenant_check/notification.rb
Instance Attribute Summary collapse
-
#base_class ⇒ Object
readonly
Returns the value of attribute base_class.
-
#callers ⇒ Object
readonly
Returns the value of attribute callers.
-
#filtered_callers ⇒ Object
readonly
Returns the value of attribute filtered_callers.
-
#sql ⇒ Object
readonly
Returns the value of attribute sql.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #filtered_callers_or_callers ⇒ Object
- #hash ⇒ Object
-
#initialize(callers, base_class, sql) ⇒ Notification
constructor
A new instance of Notification.
- #message ⇒ Object
Constructor Details
#initialize(callers, base_class, sql) ⇒ Notification
Returns a new instance of Notification.
9 10 11 12 13 14 |
# File 'lib/tenant_check/notification.rb', line 9 def initialize(callers, base_class, sql) @callers = callers @filtered_callers = StackTraceFilter.filter_in_project(callers) @base_class = base_class @sql = sql end |
Instance Attribute Details
#base_class ⇒ Object (readonly)
Returns the value of attribute base_class.
7 8 9 |
# File 'lib/tenant_check/notification.rb', line 7 def base_class @base_class end |
#callers ⇒ Object (readonly)
Returns the value of attribute callers.
7 8 9 |
# File 'lib/tenant_check/notification.rb', line 7 def callers @callers end |
#filtered_callers ⇒ Object (readonly)
Returns the value of attribute filtered_callers.
7 8 9 |
# File 'lib/tenant_check/notification.rb', line 7 def filtered_callers @filtered_callers end |
#sql ⇒ Object (readonly)
Returns the value of attribute sql.
7 8 9 |
# File 'lib/tenant_check/notification.rb', line 7 def sql @sql end |
Instance Method Details
#eql?(other) ⇒ Boolean
20 21 22 |
# File 'lib/tenant_check/notification.rb', line 20 def eql?(other) base_class == other.base_class && callers == other.callers end |
#filtered_callers_or_callers ⇒ Object
16 17 18 |
# File 'lib/tenant_check/notification.rb', line 16 def filtered_callers_or_callers filtered_callers.empty? ? callers : filtered_callers end |
#hash ⇒ Object
24 25 26 |
# File 'lib/tenant_check/notification.rb', line 24 def hash [base_class, callers].hash end |
#message ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/tenant_check/notification.rb', line 28 def <<~EOS >>> Query without tenant condition detected! class: #{base_class} sql: #{sql} stacktrace: #{filtered_callers_or_callers.join("\n")} EOS end |