Class: Specify::Model::AppResourceData

Inherits:
Object
  • Object
show all
Defined in:
lib/specify/models/app_resource_data.rb

Instance Method Summary collapse

Instance Method Details

#before_createObject


16
17
18
19
20
# File 'lib/specify/models/app_resource_data.rb', line 16

def before_create
  self.Version = 0
  self.TimestampCreated = Time.now
  super
end

#before_updateObject


22
23
24
25
26
# File 'lib/specify/models/app_resource_data.rb', line 22

def before_update
  self.Version += 1
  self.TimestampModified = Time.now
  super
end

#import(data_file) ⇒ Object


28
29
30
31
# File 'lib/specify/models/app_resource_data.rb', line 28

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