Sha256: a33a068c1b502d6053badc90660c4727090cbc2ae038c360becc5b67687da31f
Contents?: true
Size: 995 Bytes
Versions: 62
Compression:
Stored size: 995 Bytes
Contents
module Workarea module DataFile class Export include ApplicationDocument include Operation field :query_id, type: String, default: AdminSearchQueryWrapper.new.to_global_id field :ids, type: Array, default: [] field :exclude_ids, type: Array, default: [] field :emails, type: Array, default: [] list_field :emails validate :emails_are_valid def process! set(started_at: Time.current) run_callbacks(:process) { format.export! } update_attributes!(file: tempfile.tap(&:close), completed_at: Time.current) end def models @models ||= AdminQueryOperation.new(attributes) end private def emails_are_valid return unless emails.present? validator = EmailValidator.new(attributes: attributes) emails.each do |email| validator.validate_each(self, :emails, email) break if errors[:emails].any? end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems