app/models/edition.rb in govuk_content_models-31.2.2 vs app/models/edition.rb in govuk_content_models-31.3.0

- old
+ new

@@ -172,11 +172,11 @@ # fields will likely be meaningless. def fields_to_copy(target_class) if target_class == self.class base_field_keys + type_specific_field_keys else - base_field_keys + base_field_keys + common_type_specific_field_keys(target_class) end end def build_clone(target_class=nil) unless state == "published" @@ -338,7 +338,11 @@ ] end def type_specific_field_keys (self.fields.keys - Edition.fields.keys).map(&:to_sym) + end + + def common_type_specific_field_keys(target_class) + ((self.fields.keys & target_class.fields.keys) - Edition.fields.keys).map(&:to_sym) end end