Sha256: 0b730d5f1b65623f6a84f76834ad8de68b18d17f7f36d359960950ff85994795

Contents?: true

Size: 672 Bytes

Versions: 8

Compression:

Stored size: 672 Bytes

Contents

require_relative 'abstract_migration_generator'

class Sufia::Models::CachedStatsGenerator < Sufia::Models::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 STATS CACHING-RELATED SUFIA MODELS", :blue)
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-models-6.7.0 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.6.1 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.6.0 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.5.0 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.4.0 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.3.0 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.2.0 lib/generators/sufia/models/cached_stats_generator.rb
sufia-models-6.1.0 lib/generators/sufia/models/cached_stats_generator.rb