Module: RubyLLM::Mongoid::GridFsAttachment::ClassMethods

Defined in:
lib/ruby_llm/mongoid/grid_fs_attachment.rb

Instance Method Summary collapse

Instance Method Details

#gridfs_bucketObject



74
75
76
77
78
79
# File 'lib/ruby_llm/mongoid/grid_fs_attachment.rb', line 74

def gridfs_bucket
  @gridfs_bucket ||= ::Mongo::Grid::FSBucket.new(
    ::Mongoid.default_client.database,
    fs_name: gridfs_bucket_name
  )
end

#gridfs_bucket_nameObject



70
71
72
# File 'lib/ruby_llm/mongoid/grid_fs_attachment.rb', line 70

def gridfs_bucket_name
  @gridfs_bucket_name ||= "attachments"
end

#use_gridfs_bucket(name) ⇒ Object



65
66
67
68
# File 'lib/ruby_llm/mongoid/grid_fs_attachment.rb', line 65

def use_gridfs_bucket(name)
  @gridfs_bucket_name = name.to_s
  @_gridfs_bucket = nil
end