diff --git a/app/models/metadata_has_many.rb b/app/models/metadata_has_many.rb index 13f0dcf5..b4db4454 100644 --- a/app/models/metadata_has_many.rb +++ b/app/models/metadata_has_many.rb @@ -36,6 +36,8 @@ class MetadataHasMany < MetadataRelatedPosts def save super + self[:value] = self[:value].uniq + return true unless changed? return true unless inverse? diff --git a/app/views/posts/attributes/_new_belongs_to.haml b/app/views/posts/attributes/_new_belongs_to.haml index 8cbe3ce0..7f9a66dd 100644 --- a/app/views/posts/attributes/_new_belongs_to.haml +++ b/app/views/posts/attributes/_new_belongs_to.haml @@ -26,7 +26,6 @@ %span.placeholder.w-100 .form-group - = hidden_field_tag name, '' .d-flex.align-items-center.justify-content-between %div = label_tag id, post_label_t(attribute, post: post), class: 'mb-0' diff --git a/app/views/posts/attributes/_new_has_many.haml b/app/views/posts/attributes/_new_has_many.haml index 3869591b..ff657359 100644 --- a/app/views/posts/attributes/_new_has_many.haml +++ b/app/views/posts/attributes/_new_has_many.haml @@ -26,7 +26,6 @@ %span.placeholder.w-100 .form-group - = hidden_field_tag name, '' .d-flex.align-items-center.justify-content-between %div = label_tag id, post_label_t(attribute, post: post), class: 'h3'