app/models/data_object.rb
# NOTE - description required, and published will default to false from the DB, so you PROBABLLY want to specify it.
description required, and published will default to false from the DB, so you PROBABLLY want to specify it.
description required and published will default to false from the DB so you PROBABLLY want to specify it .
def default_values 
    if defined?(PhusionPassenger)
      UUID.state_file(0664) 
    end
    self.guid ||= UUID.generate.gsub('-','')
    self.identifier ||= ''
    self.data_type_id ||= DataType.text.id
    self.mime_type_id ||= MimeType.find_by_translated(:label, 'text/plain').id
    self.location ||= ''
    self.latitude ||= 0
    self.longitude ||= 0
    self.altitude ||= 0
    self.object_url ||= ''
    self.thumbnail_url ||= ''
    self.object_title ||= ''
    self.language_id ||= Language.default.id
    self.license_id ||= License.default.id
    self.rights_statement ||= ''
    self.bibliographic_citation ||= ''
    self.source_url ||= ''
    self.data_rating ||= 2.5
  end
def default_values if defined? ( PhusionPassenger ) UUID . state_file ( 0664 ) end self . guid ||= UUID . generate . gsub ( '-' , '' ) self . identifier ||= '' self . data_type_id ||= DataType . text . id self . mime_type_id ||= MimeType . find_by_translated ( :label , 'text/plain' ) . id self . location ||= '' self . latitude ||= 0 self . longitude ||= 0 self . altitude ||= 0 self . object_url ||= '' self . thumbnail_url ||= '' self . object_title ||= '' self . language_id ||= Language . default . id self . license_id ||= License . default . id self . rights_statement ||= '' self . bibliographic_citation ||= '' self . source_url ||= '' self . data_rating ||= 2.5 end
NOTE - description required, and published will default to false from the DB, so you PROBABLLY want to specify it.
NOTE - description required and published will default to false from the DB so you PROBABLLY want to specify it .
# Ideally, these would be in the DB, but I didn't want to take that step.  ...yet. # Makes the file writable, which we seem to need to do with Passenger...