Class: Devise::Async::Stretch::PopulateStretchMarksGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Devise::Async::Stretch::PopulateStretchMarksGenerator
- Defined in:
- lib/generators/devise/async/stretch/populate_stretch_marks_generator.rb
Instance Method Summary collapse
Instance Method Details
#populate_stretch_marks ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/generators/devise/async/stretch/populate_stretch_marks_generator.rb', line 12 def populate_stretch_marks name.constantize.to_adapter.find_all.each do |record| if record.stretch_mark.blank? record.update(stretch_mark: SecureRandom.hex(15)[0,29]) end end end |