Sha256: 93260dbbdabf160ae17d2d7a6be6627a7a18eb019bac373d3962001950af4779

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

= TPOptimistic

This gem improve the ActiveRecord to trate ActiveRecord::RecordNotUnique with optimistic behavior

exemplo:

  def sample
    Bar.create(uuid: '5ea880de-e4ce-4770-8d10-c89bac181e40', other: 'bla bla')
    bar = Bar.create(uuid: '5ea880de-e4ce-4770-8d10-c89bac181e40', other: 'bla bla')
    
    #UNIQUE constraint failed
    bar.errors
  end


  def other_sample
    Bar.create!(uuid: '5ea880de-e4ce-4770-8d10-c89bac181e40', other: 'bla bla')
    #ActiveRecord::RecordInvalid UNIQUE constraint failed
    Bar.create!(uuid: '5ea880de-e4ce-4770-8d10-c89bac181e40', other: 'bla bla')
  end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tp_record_optimistic-0.2.1 README.rdoc
tp_record_optimistic-0.2.0 README.rdoc