Skip to content

Commit

Permalink
Retain compatibility with #bbe2fda / PR #1152 on main
Browse files Browse the repository at this point in the history
  • Loading branch information
aldavidson authored and brucebolt committed Dec 27, 2023
1 parent bfef499 commit 5932dfc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions app/models/content_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def access_limited?
access_limited_user_ids.any? || access_limited_organisation_ids.any?
end

def register_routes
return unless should_register_routes?
def register_routes(previous_item: nil)
return unless should_register_routes?(previous_item:)

tries = Rails.application.config.register_router_retries
begin
Expand All @@ -183,13 +183,8 @@ def route_set

private

def should_register_routes?
return false if schema_name.to_s.start_with?("placeholder")

if previous_item
return previous_item.schema_name == "placeholder" ||
previous_item.route_set != route_set
end
def should_register_routes?(previous_item: nil)
return previous_item.route_set != route_set if previous_item

true
end
Expand Down

0 comments on commit 5932dfc

Please sign in to comment.