Method: Atech::ObjectStore::File#reload

Defined in:
lib/atech/object_store/file.rb

#reload(include_blob = false) ⇒ Object

Reload properties from the database. Optionally, pass true to include the blob in the update



166
167
168
169
# File 'lib/atech/object_store/file.rb', line 166

def reload(include_blob = false)
  query = File.execute_query("SELECT #{include_blob ? '*' : '`id`, `name`, `size`, `created_at`, `updated_at`'} FROM files WHERE id = #{@attributes['id']}").first
  @attributes.merge!(parsed_attributes(query))
end