Module: Dynomite::Item::Id
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/dynomite/item/id.rb
Instance Method Summary collapse
Instance Method Details
#generate_id ⇒ Object
15 16 17 |
# File 'lib/dynomite/item/id.rb', line 15 def generate_id "#{id_prefix}-#{SecureRandom.alphanumeric(16)}" end |
#id_prefix ⇒ Object
19 20 21 |
# File 'lib/dynomite/item/id.rb', line 19 def id_prefix self.class.id_prefix_value end |
#set_id ⇒ Object
10 11 12 13 |
# File 'lib/dynomite/item/id.rb', line 10 def set_id return if self.class.disable_id? self.id ||= generate_id end |