Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignores no_returning #826

Open
9mm opened this issue Feb 4, 2024 · 0 comments
Open

Ignores no_returning #826

9mm opened this issue Feb 4, 2024 · 0 comments

Comments

@9mm
Copy link

9mm commented Feb 4, 2024

    rows = fired.map{|f| {
      "identifier_id" => f.dig("identifier", "id"),
      "trigger_id" => f.dig("trigger", "id"),
    }}
    FiredTrigger.import(rows,
      validate: false,
      validate_uniqueness: false,
      track_validation_failures: false,
      timestamps: false,
      raise_error: true,
      no_returning: true, # ignores this for some reason...
    )

I have tried every conceivable way to get it to STOP adding RETURNING "id" including what you see above, as well as

returning: nil, returning: []

It ignores everything, and always adds it.

I have also tried this:

    FiredTrigger.import(rows,
      no_returning: true, # ignores this for some reason...
    )
class CreateFiredTriggers < ActiveRecord::Migration[7.1]
  def change
    create_table :fired_triggers do |t|
      t.references :identifier, null: false
      t.references :trigger,    null: false
      t.datetime   :fired_at,   null: false, default: -> { "CURRENT_TIMESTAMP" }
    end

    add_index :fired_triggers, :fired_at
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant