Class: FileVersion

Inherits:
Sequel::Model
  • Object
show all
Includes:
ASModel, Publishable
Defined in:
backend/app/model/file_version.rb

Class Method Summary (collapse)

Methods included from Publishable

db_value_for, included

Methods included from ASModel

all_models, included, update_publish_flag, update_suppressed_flag

Methods included from JSONModel

JSONModel, #JSONModel, add_error_handler, all, allow_unmapped_enum_value, backend_url, client_mode?, custom_validations, destroy_model, enum_default_value, enum_values, handle_error, init, load_schema, #models, models, parse_jsonmodel_ref, parse_reference, repository, repository_for, schema_src, set_repository, strict_mode, strict_mode?, with_repository

Class Method Details

+ (Object) handle_publish_flag(ids, val)



9
10
11
# File 'backend/app/model/file_version.rb', line 9

def self.handle_publish_flag(ids, val)
  ASModel.update_publish_flag(self.filter(:id => ids), val)
end

+ (Object) sequel_to_jsonmodel(objs, opts = {})



15
16
17
18
19
20
21
22
23
# File 'backend/app/model/file_version.rb', line 15

def self.sequel_to_jsonmodel(objs, opts = {})
  jsons = super

  jsons.zip(objs).each do |json, obj|
    json["identifier"] = obj[:id].to_s
  end

  jsons
end