Sha256: b52a1f0126cdeecd2f919bd880e2830a395ddf53541523f74d3fb27598047a12
Contents?: true
Size: 808 Bytes
Versions: 4
Compression:
Stored size: 808 Bytes
Contents
module Spontaneous module Cli class Fields < ::Thor include Spontaneous::Cli::TaskUtils include ::Simultaneous::Task namespace :fields desc "update", "Performs asynchronous updates on provided fields" method_option :fields, :type => :array, :desc => "List of field IDs to update" def update prepare! :update, :console fields = Spontaneous::Field.find(*options.fields) updater = Spontaneous::Field::Update::Immediate.new(fields) updater.run send_completion_event(updater) end private def send_completion_event(updater) unlocked_pages = updater.pages.reject { |p| p.locked_for_update? } simultaneous_event('page_lock_status', unlocked_pages.map(&:id).to_json) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems