mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Fix adding items without a position (#38368)
This commit is contained in:
@@ -62,7 +62,7 @@ class CollectionItem < ApplicationRecord
|
||||
private
|
||||
|
||||
def set_position
|
||||
return if position_changed?
|
||||
return if position.present? && position_changed?
|
||||
|
||||
self.position = self.class.where(collection_id:).maximum(:position).to_i + 1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user