Class: MultipleMan::AsyncModelPublisher
- Inherits:
-
ModelPublisher
- Object
- ModelPublisher
- MultipleMan::AsyncModelPublisher
- Defined in:
- lib/multiple_man/async_model_publisher.rb
Instance Method Summary collapse
Methods inherited from ModelPublisher
Constructor Details
This class inherits a constructor from MultipleMan::ModelPublisher
Instance Method Details
#publish(records, operation = :create) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/multiple_man/async_model_publisher.rb', line 4 def publish(records, operation=:create) return unless MultipleMan.configuration.enabled if records.respond_to?(:pluck) return unless records.any? ids = records.pluck(:id) klass = records.first.class.name else return if records.nil? ids = [records.id] klass = records.class.name end ModelPublisherJob.perform_async(klass, ids, , operation) end |