Fix moving closet hanger to null-list
Rails 5 added new validation on `belongs_to` to ensure the corresponding record exists. In the case of moving to the null list, this shouldn't trigger! I wish we could flag that specifically `nil` is okay, but other values should be validated? But oh well, this is fine!
This commit is contained in:
parent
21201e8930
commit
62fcc9fe00
1 changed files with 1 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
class ClosetHanger < ApplicationRecord
|
class ClosetHanger < ApplicationRecord
|
||||||
belongs_to :item
|
belongs_to :item
|
||||||
belongs_to :list, :class_name => 'ClosetList'
|
belongs_to :list, class_name: 'ClosetList', optional: true
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
delegate :name, to: :item, prefix: true
|
delegate :name, to: :item, prefix: true
|
||||||
|
|
Loading…
Reference in a new issue