Skip to content

Commit

Permalink
Use attribute for parent_id (opf#6090)
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
oliverguenther committed Dec 18, 2017
1 parent a449b08 commit e980828
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/work_package/parent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
module WorkPackage::Parent
def self.prepended(base)
base.after_save :update_parent_relation
base.define_attribute_method 'parent_id'
base.attribute 'parent_id', :integer
base.define_attribute_method 'parent'
end

Expand All @@ -51,6 +51,10 @@ def parent=(work_package)
end
end

def parent_will_change!
parent_id_will_change!
end

def parent
if @parent_set
@parent_object || parent_from_id
Expand Down

0 comments on commit e980828

Please sign in to comment.