Module: PrettyId
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/pretty_id.rb,
lib/pretty_id/version.rb,
lib/pretty_id/generator.rb,
lib/pretty_id/sec_random.rb
Defined Under Namespace
Classes: Generator, SecRandom
Constant Summary
collapse
- VERSION =
"0.1.2"
Instance Method Summary
collapse
Instance Method Details
#_create_record ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/pretty_id.rb', line 25
def _create_record(*)
attempt ||= 1
set_pretty_id
super
rescue ActiveRecord::RecordNotUnique => e
attempt += 1
retry if attempt < 4
raise
end
|