Sha256: 309734b23d8e2ebc49e19c450237fc7585eaf42e4c955105bd5affafde8affc2

Contents?: true

Size: 523 Bytes

Versions: 10

Compression:

Stored size: 523 Bytes

Contents

# Model for storing portion of bytes from particular Neofiles::File. Has only two fields: the bytes string #data
# and sequence number #n
#
class Neofiles::FileChunk

  include Mongoid::Document

  store_in collection: Rails.application.config.neofiles.mongo_chunks_collection, client: Rails.application.config.neofiles.mongo_client

  belongs_to :file, class_name: 'Neofiles::File'

  field :n, type: Integer, default: 0 # что это за поле?
  field :data, type: BSON::Binary

  def to_s
    data.data
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
neofiles-1.1.2 app/models/neofiles/file_chunk.rb
neofiles-1.1.1 app/models/neofiles/file_chunk.rb
neofiles-1.1.0 app/models/neofiles/file_chunk.rb
neofiles-1.0.6 app/models/neofiles/file_chunk.rb
neofiles-1.0.5 app/models/neofiles/file_chunk.rb
neofiles-1.0.4 app/models/neofiles/file_chunk.rb
neofiles-1.0.3 app/models/neofiles/file_chunk.rb
neofiles-1.0.2 app/models/neofiles/file_chunk.rb
neofiles-1.0.1 app/models/neofiles/file_chunk.rb
neofiles-1.0.0 app/models/neofiles/file_chunk.rb