Class: Specify::Model::AppResourceData

Inherits:
Object
  • Object
show all
Includes:
Createable, Updateable
Defined in:
lib/specify/models/app_resource_data.rb

Overview

AppResourceData hold data the Specify application uses (usually in the form of XML files that are stored as blobs).

An AppResourceData belongs to a #viewsetobj (an instance of Specify::Model::ViewSetObject) or AppResource (not implemented).

Instance Method Summary collapse

Methods included from Updateable

#before_update

Methods included from Createable

#before_create

Instance Method Details

#import(data_file) ⇒ Object

Stores the contents of data_file (typically an .xml file) as a blob in the database.



26
27
28
29
# File 'lib/specify/models/app_resource_data.rb', line 26

def import(data_file)
  self.data = Sequel.blob(File.read(data_file))
  save
end