Skip to content

issues Search Results · repo:Shopify/activerecord-rescue_from_duplicate language:Ruby

Filter by

8 results
 (111 ms)

8 results

inShopify/activerecord-rescue_from_duplicate (press backspace or delete to remove)

In Postgres, if you 1. have a transaction open 2. something which invokes non bang save/update on a rescued class 3. rescue a ActiveRecord::RecordNotUnique / PG::UniqueViolation 4. the transaction ...
  • bf4
  • Opened 
    on Feb 11, 2024
  • #33

Since the code would be in the same place, any interest in turning ActiveRecord::InvalidForeignKey errors into validation errors? Same risks apply, I think, as ActiveRecord::RecordNotUnique. We use validations ...
  • bf4
  • Opened 
    on Feb 6, 2024
  • #32

Not sure where the change in Rails is, but looking at the test suite, I suspect it just wasn t run in a while? tl;dr # @raise ActiveRecord::RecordNotSaved def create_or_update(...) super rescue ...
  • bf4
  • 1
  • Opened 
    on Jul 14, 2022
  • #21

Hi 👋🏼 I read in the README that this gem will throw a RecordNotSaved exception on create!. I would like to understand why is that the case instead of returning a RecordInvalid and where is this in the ...
  • geclos
  • Opened 
    on Nov 23, 2021
  • #20

How to properly test rescue_from_duplicate? And on another note: add_index :table, fk_id, lower(code) , unique: true, algorithm: :concurrently will trigger an error when calling missing indexes: irb(main):001:0 ...
  • danielnc
  • 3
  • Opened 
    on Feb 7, 2019
  • #16

I have two classes, A and B, and a relation C between them. Essentially, an instance of B is a subset of As. Thus, I want to make sure that each B contains at most one of each A. This translates to a validation ...
  • Mangara
  • 9
  • Opened 
    on Apr 23, 2018
  • #14

Considering two models Parent and Child where Child has a uniqueness constraint using rescue_from_duplicate. When we instantiate Parent with a Child (not saved yet) that is not unique, there are two possible ...
  • wkjagt
  • 3
  • Opened 
    on Oct 3, 2016
  • #13

As @matthewd pointed out, PG exceptions offer an API to get metadata about the exception, notably the concerned columns: http://www.rubydoc.info/gems/pg/PG/Result#error_field-instance_method It might ...
enhancement
  • byroot
  • 1
  • Opened 
    on Sep 30, 2015
  • #10
Issue origami icon

Learn how you can use GitHub Issues to plan and track your work.

Save views for sprints, backlogs, teams, or releases. Rank, sort, and filter issues to suit the occasion. The possibilities are endless.Learn more about GitHub Issues
ProTip! 
Restrict your search to the title by using the in:title qualifier.
Issue origami icon

Learn how you can use GitHub Issues to plan and track your work.

Save views for sprints, backlogs, teams, or releases. Rank, sort, and filter issues to suit the occasion. The possibilities are endless.Learn more about GitHub Issues
ProTip! 
Restrict your search to the title by using the in:title qualifier.
Issue search results · GitHub