def add_to_list
      if in_list?
        move_to_bottom
      else
        list_class.transaction do
          ids = lock_list!
          last_position = ids.size
          if persisted?
            update_position last_position + 1
          else
            set_position last_position + 1
          end
        end
      end
    end
def add_to_list
      if in_list?
        move_to_bottom
      else
        list_class.transaction do
          ids = lock_list!
          last_position = ids.size
          if persisted?
            update_position last_position + 1
          else
            set_position last_position + 1
          end
        end
      end
    end
def add_to_list if in_list? move_to_bottom else list_class . transaction do ids = lock_list! last_position = ids . size if persisted? update_position last_position + 1 else set_position last_position + 1 end end end end
Add the item to the end of the list
Add the item to the end of the list