Skip to content

Commit 4329aaa

Browse files
authored
Update resort.rb
applies change found in this unmerged PR codegram#21
1 parent 707a813 commit 4329aaa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/resort.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def included(base)
6262
base.send :include, InstanceMethods
6363

6464
base.has_one :previous, class_name: base.name, foreign_key: 'next_id', inverse_of: :next
65-
base.belongs_to :next, class_name: base.name, inverse_of: :previous
65+
base.belongs_to :next, class_name: base.name, inverse_of: :previous, optional: true
6666

6767
base.after_create :include_in_list!
6868
base.after_destroy :delete_from_list

0 commit comments

Comments
 (0)