Sha256: 27c79f3509223d7b45d3c5c6380c589022f18fd6d0f5b4c4d0e5db4b53ef4574

Contents?: true

Size: 542 Bytes

Versions: 37

Compression:

Stored size: 542 Bytes

Contents

module Apidae
  class Export < ActiveRecord::Base

    PENDING = 'pending'
    COMPLETE = 'complete'
    CANCELLED = 'cancelled'

    validates_presence_of :file_url, :project_id

    before_save :normalize_url

    def normalize_url
      self.file_url = file_url.strip
      unless file_url.include?('/')
        self.file_url = "http://export.apidae-tourisme.com/exports/#{file_url}"
      end
    end

    # Note : handle reset case
    def self.pending
      where(remote_status: 'SUCCESS', status: PENDING).order(:id)
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
apidae-1.2.35 app/models/apidae/export.rb
apidae-1.2.34 app/models/apidae/export.rb
apidae-1.2.33 app/models/apidae/export.rb
apidae-1.2.32 app/models/apidae/export.rb
apidae-1.2.31 app/models/apidae/export.rb
apidae-1.2.30 app/models/apidae/export.rb
apidae-1.2.29 app/models/apidae/export.rb
apidae-1.2.28 app/models/apidae/export.rb
apidae-1.2.27 app/models/apidae/export.rb
apidae-1.2.26 app/models/apidae/export.rb
apidae-1.2.25 app/models/apidae/export.rb
apidae-1.2.24 app/models/apidae/export.rb
apidae-1.2.23 app/models/apidae/export.rb
apidae-1.2.22 app/models/apidae/export.rb
apidae-1.2.21 app/models/apidae/export.rb
apidae-1.2.20 app/models/apidae/export.rb
apidae-1.2.19 app/models/apidae/export.rb
apidae-1.2.18 app/models/apidae/export.rb
apidae-1.2.17 app/models/apidae/export.rb
apidae-1.2.16 app/models/apidae/export.rb