Skip to content

rails db:seed needs several runs #11119

Description

@ChrisBAshton
$ run rails db:seed                                                                                                                                                

bin/rails aborted!
ArgumentError: After commit callback :publish_to_publishing_api has not been defined (ArgumentError)

                raise ArgumentError, "#{type.to_s.capitalize} #{name} callback #{filter.inspect} has not been defined"
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/govuk/whitehall/db/seeds.rb:30:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

$ run rails db:seed

bin/rails aborted!
NoMethodError: undefined method `content_id' for nil (NoMethodError)

        world_location_news: [item.world_location_news.content_id],
                                                      ^^^^^^^^^^^
/govuk/whitehall/app/presenters/publishing_api/world_location_presenter.rb:33:in `links'
/govuk/whitehall/lib/whitehall/publishing_api.rb:87:in `patch_links'
/govuk/whitehall/lib/publishes_to_publishing_api.rb:33:in `block in publish_to_publishing_api'
/govuk/whitehall/lib/publishes_to_publishing_api.rb:32:in `publish_to_publishing_api'
/govuk/whitehall/db/seeds.rb:54:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

# third attempt worked

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions