@@ -18,20 +18,24 @@ def update
1818 updated = model
1919 updated = update_identification ( updated ) if changed? ( :source_id ) || changed? ( :catkey )
2020 updated = updated_access ( updated ) if access_changed?
21- updated = updated_administrative ( updated ) if changed? ( :admin_policy_id )
21+ updated = updated_administrative ( updated ) if administrative_changed?
2222 object_client . update ( params : updated )
2323 end
2424
2525 private
2626
2727 attr_reader :model , :change_set
2828
29- delegate :admin_policy_id , :license , :copyright , :use_statement , :catkey , :changed? , to : :change_set
29+ delegate :admin_policy_id , :project , : license, :copyright , :use_statement , :catkey , :changed? , to : :change_set
3030
3131 def access_changed?
3232 changed? ( :copyright ) || changed? ( :license ) || changed? ( :use_statement )
3333 end
3434
35+ def administrative_changed?
36+ changed? ( :admin_policy_id ) || changed? ( :project )
37+ end
38+
3539 def updated_access ( updated )
3640 access_properties = {
3741 copyright : changed? ( :copyright ) ? copyright : updated . access . copyright ,
@@ -49,7 +53,11 @@ def update_identification(updated)
4953 end
5054
5155 def updated_administrative ( updated )
52- updated_administrative = updated . administrative . new ( hasAdminPolicy : admin_policy_id )
56+ properties = { }
57+ properties [ :hasAdminPolicy ] = admin_policy_id if changed? ( :admin_policy_id )
58+ properties [ :partOfProject ] = project if changed? ( :project )
59+
60+ updated_administrative = updated . administrative . new ( properties )
5361 updated . new ( administrative : updated_administrative )
5462 end
5563
0 commit comments