Sha256: 91fc2c8c4125647069ce2d799270c41d0d854f9f0e3153698003174157f4d5f8

Contents?: true

Size: 656 Bytes

Versions: 3

Compression:

Stored size: 656 Bytes

Contents

require_relative 'abstract_migration_generator'

class Sufia::CachedWorkStatsGenerator < Sufia::AbstractMigrationGenerator
  source_root File.expand_path('../templates', __FILE__)

  desc """
This generator adds the ability to cache usage stats to your application:
 1. Creates several database migrations if they do not exist in /db/migrate
       """

  def banner
    say_status("info", "ADDING WORK STATS CACHING-RELATED TABLES", :blue)
  end

  # Setup the database migrations
  def copy_migrations
    [
      'create_work_view_stats.rb',
      'add_works_to_user_stats.rb'
    ].each do |file|
      better_migration_template file
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sufia-7.0.0.beta3 lib/generators/sufia/cached_work_stats_generator.rb
sufia-7.0.0.beta2 lib/generators/sufia/cached_work_stats_generator.rb
sufia-7.0.0.beta1 lib/generators/sufia/cached_work_stats_generator.rb