Class: RdeTemplate
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- RdeTemplate
show all
- Includes:
- ASModel
- Defined in:
- backend/app/model/rde_template.rb
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
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) create_from_json(json, opts = {})
20
21
22
23
24
25
|
# File 'backend/app/model/rde_template.rb', line 20
def self.create_from_json(json, opts = {})
super(json, opts.merge('order' => JSON(json.order || []),
'visible' => JSON(json.visible || []),
'defaults' => JSON(json.defaults || {})
))
end
|
+ (Object) sequel_to_jsonmodel(objs, opts = {})
8
9
10
11
12
13
14
15
16
17
18
|
# File 'backend/app/model/rde_template.rb', line 8
def self.sequel_to_jsonmodel(objs, opts = {})
jsons = super
jsons.zip(objs).each do |json, obj|
json['order'] = ASUtils.json_parse(obj.order)
json['visible'] = ASUtils.json_parse(obj.visible)
json['defaults'] = ASUtils.json_parse(obj.defaults)
end
jsons
end
|
Instance Method Details
- (Object) update_from_json(json, opts = {}, apply_nested_records = true)
28
29
30
31
32
33
|
# File 'backend/app/model/rde_template.rb', line 28
def update_from_json(json, opts = {}, apply_nested_records = true)
super(json, opts.merge('order' => JSON(json.order || []),
'visible' => JSON(json.visible || []),
'defaults' => JSON(json.defaults || {})
))
end
|