Sha256: eedd6c6d01330560c9233db390423b8f996432d5aefc7814dee26c86026aead8

Contents?: true

Size: 324 Bytes

Versions: 7

Compression:

Stored size: 324 Bytes

Contents

namespace :log_book do
  desc 'Update meta of CLASS'
  task update_meta: :environment do
    ENV['CLASS'].constantize.with_records.each do |model|
      model.records.each do |record|
        record.meta = record.meta.reverse_merge(model.log_book_meta(record).stringify_keys)
        record.save
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_log_book-2.4.0 lib/tasks/log_book.rake
rails_log_book-2.3.0 lib/tasks/log_book.rake
rails_log_book-2.2.0 lib/tasks/log_book.rake
rails_log_book-2.1.0 lib/tasks/log_book.rake
rails_log_book-1.0.0 lib/tasks/log_book.rake
rails_log_book-0.3.0 lib/tasks/log_book.rake
rails_log_book-0.2.0 lib/tasks/log_book.rake