Sha256: 08a823d3613f86add4b36b8e2897b9e0fabaafb128f742314c238fd5caf79167
Contents?: true
Size: 955 Bytes
Versions: 51
Compression:
Stored size: 955 Bytes
Contents
require 'fiona7/builder/obj_class_builder' module Fiona7 module Builder class ObjClassUpdater < ObjClassBuilder def validate existing_obj_class end protected def existing_obj_class ret = RailsConnector::ObjClass.exists?(obj_class_name: @values[:name]) @error_msg = "Expected #{@values[:name]} to exist" unless ret ret end def persist_obj_class @raw_obj_class = Reactor::Cm::ObjClass.get(@values[:name].to_s) user_attributes = @attributes.map {|a| a[:real_name] } user_attributes ||= [] existing_attributes = @raw_obj_class.attributes built_in_attributes = Fiona7::Initializer::ATTRIBUTES_MAP.keys # NOTE: removing attributes is now impossible new_attributes = (existing_attributes + built_in_attributes + user_attributes).map(&:to_s).uniq @raw_obj_class.attributes = new_attributes end end end end
Version data entries
51 entries across 51 versions & 1 rubygems