diff --git a/app/models/compound_form/base.rb b/app/models/compound_form/base.rb index 82806bc..921839a 100644 --- a/app/models/compound_form/base.rb +++ b/app/models/compound_form/base.rb @@ -2,12 +2,15 @@ class CompoundForm::Base < ApplicationRecord class_attribute :rdf_namespace, :rdf_predicate + self.rdf_namespace = 'iqvoc' self.rdf_predicate = 'compoundFrom' self.table_name ='compound_forms' - belongs_to :domain, :class_name => 'Label::Base', :foreign_key => 'domain_id' + belongs_to :domain, + class_name: 'Label::Base', + foreign_key: 'domain_id' has_many :compound_form_contents, class_name: 'CompoundForm::Content::Base', diff --git a/app/models/compound_form/content/base.rb b/app/models/compound_form/content/base.rb index c42d108..eac8be7 100644 --- a/app/models/compound_form/content/base.rb +++ b/app/models/compound_form/content/base.rb @@ -4,8 +4,13 @@ class CompoundForm::Content::Base < ApplicationRecord self.table_name ='compound_form_contents' - belongs_to :compound_form, :class_name => 'CompoundForm::Base', :foreign_key => 'compound_form_id' - belongs_to :label, :class_name => 'Label::Base', :foreign_key => 'label_id' + belongs_to :compound_form, + class_name: 'CompoundForm::Base', + foreign_key: 'compound_form_id' + + belongs_to :label, + class_name: 'Label::Base', + foreign_key: 'label_id' def self.label_published includes(:label).references(:labels).merge(Label::Base.published) diff --git a/app/models/concerns/compound_forms_label_extensions.rb b/app/models/concerns/compound_forms_label_extensions.rb index f3a897a..21c45d1 100644 --- a/app/models/concerns/compound_forms_label_extensions.rb +++ b/app/models/concerns/compound_forms_label_extensions.rb @@ -37,8 +37,7 @@ module CompoundFormsLabelExtensions has_many :compound_form_contents, through: :compound_forms, - class_name: "CompoundForm::Content::Base", - dependent: :destroy + class_name: "CompoundForm::Content::Base" validate :compound_form_contents_size validate :compound_form_contents_languages