Sha256: 54045d42a31094d1b61286725bafd388303f473cf7caeea5412c9de8c781eab8

Contents?: true

Size: 745 Bytes

Versions: 17

Compression:

Stored size: 745 Bytes

Contents

require_dependency "renalware/feeds"

module Renalware
  module Feeds
    class File < ApplicationRecord
      include Accountable
      extend Enumerize

      validates :location, presence: true
      validates :status, presence: true
      validates :created_by, presence: true
      validates :file_type, presence: true

      belongs_to :file_type

      enum status: { waiting: 0, processing: 1, success: 2, failure: 3 }

      scope :ordered, ->{ order(created_at: :desc) }

      def self.build(location:, file_type:, user: SystemUser.find)
        new(
          location: location,
          file_type: file_type,
          status: :waiting,
          updated_by: user,
          created_by: user
        )
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/feeds/file.rb
renalware-core-2.0.7 app/models/renalware/feeds/file.rb
renalware-core-2.0.5 app/models/renalware/feeds/file.rb
renalware-core-2.0.4 app/models/renalware/feeds/file.rb
renalware-core-2.0.3 app/models/renalware/feeds/file.rb
renalware-core-2.0.2 app/models/renalware/feeds/file.rb
renalware-core-2.0.1 app/models/renalware/feeds/file.rb
renalware-core-2.0.0 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/feeds/file.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/feeds/file.rb