Class: RailsAsyncMigrations::Mutators::TriggerCallback
- Defined in:
- lib/rails_async_migrations/mutators/trigger_callback.rb
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
Instance Method Summary collapse
-
#initialize(instance, method_name) ⇒ TriggerCallback
constructor
A new instance of TriggerCallback.
-
#perform ⇒ Object
this method can be called multiple times (we should see what manages this actually) if you use up down and change it’ll be called 3 times for example.
Methods inherited from Base
#current_migration, #fetch_from_file, #migration_class
Constructor Details
#initialize(instance, method_name) ⇒ TriggerCallback
Returns a new instance of TriggerCallback.
6 7 8 9 |
# File 'lib/rails_async_migrations/mutators/trigger_callback.rb', line 6 def initialize(instance, method_name) @instance = instance @method_name = method_name end |
Instance Attribute Details
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
4 5 6 |
# File 'lib/rails_async_migrations/mutators/trigger_callback.rb', line 4 def instance @instance end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
4 5 6 |
# File 'lib/rails_async_migrations/mutators/trigger_callback.rb', line 4 def method_name @method_name end |
Instance Method Details
#perform ⇒ Object
this method can be called multiple times (we should see what manages this actually) if you use up down and change it’ll be called 3 times for example
13 14 15 16 17 18 19 20 21 |
# File 'lib/rails_async_migrations/mutators/trigger_callback.rb', line 13 def perform unless active_record.allowed_direction? Tracer.new.verbose "Direction `#{direction}` not allowed." return end enqueue_asynchronous unless already_enqueued? check_queue end |