Sha256: aa433312d28e0048f58bcba2f819a4945af9822d031319eeee7c220bf6e59af7
Contents?: true
Size: 927 Bytes
Versions: 19
Compression:
Stored size: 927 Bytes
Contents
module Pulitzer class FreeFormSectionType < Pulitzer::ApplicationRecord include Pulitzer::PostTypeElement belongs_to :post_type_version has_many :free_form_sections has_many :partial_types, -> { order :id } accepts_nested_attributes_for :partial_types def self.export_config { except: [:id,:post_type_version_id], include: { partial_types: PartialType.export_config } } end def self.convert_nested_assoc(json_hash) json_hash[attrs_name].map!{|p_attrs| new_attrs = Pulitzer::PartialType.convert_hash_to_nested p_attrs } json_hash end def first_partial_type partial_types.first end def clone_me clone_attrs = self.attributes.dup clone_attrs.delete 'id' clone_attrs.delete 'post_type_version_id' Pulitzer::FreeFormSectionType.new(clone_attrs) end end end
Version data entries
19 entries across 19 versions & 1 rubygems