Class: Revocare::CallbackData
- Inherits:
-
Object
- Object
- Revocare::CallbackData
- Defined in:
- lib/revocare/callback_data.rb
Constant Summary collapse
- INTERNAL_MODELS =
[ "ActiveRecord::InternalMetadata", "ActiveRecord::SchemaMigration", ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ CallbackData
constructor
A new instance of CallbackData.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ CallbackData
Returns a new instance of CallbackData.
14 15 16 |
# File 'lib/revocare/callback_data.rb', line 14 def initialize @data = [] end |
Class Method Details
.to_a ⇒ Object
10 11 12 |
# File 'lib/revocare/callback_data.rb', line 10 def self.to_a new.to_a end |
Instance Method Details
#to_a ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/revocare/callback_data.rb', line 18 def to_a all_models.each do |model| callbacks = callbacks_for(model) if callbacks.any? data << { model: model.name, callbacks: format_callbacks(callbacks), } end end data end |