Created
February 18, 2016 22:50
-
-
Save mjgiarlo/36ee76c2ab267c715566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/generators/sufia/templates/migrations/add_works_to_user_stats.rb b/lib/generators/sufia/templates/migrations/add_works_to_user_stats.rb | |
index 47de968..2f63ae0 100644 | |
--- a/lib/generators/sufia/templates/migrations/add_works_to_user_stats.rb | |
+++ b/lib/generators/sufia/templates/migrations/add_works_to_user_stats.rb | |
@@ -1,12 +1,7 @@ | |
class AddWorksToUserStats < ActiveRecord::Migration | |
- def self.up | |
- AddGroupsToUsers | |
+ def change | |
+ add_column :user_stats, :work_views, :integer | |
add_column :work_view_stats, :user_id, :integer | |
add_index :work_view_stats, :user_id | |
end | |
- | |
- def self.down | |
- remove_column :work_view_stats, :user_id, :integer | |
- remove_index :work_view_stats, :user_id | |
- end | |
end | |
diff --git a/lib/generators/sufia/upgrade700_generator.rb b/lib/generators/sufia/upgrade700_generator.rb | |
index f50bcc9..19984cd 100644 | |
--- a/lib/generators/sufia/upgrade700_generator.rb | |
+++ b/lib/generators/sufia/upgrade700_generator.rb | |
@@ -33,6 +33,11 @@ This generator for upgrading sufia from 6.0.0 to 7.0 makes the following changes | |
end | |
end | |
+ # Sets up cached work usage stats | |
+ def cached_stats | |
+ generate 'sufia:cached_work_stats' | |
+ end | |
+ | |
def inject_sufia_work_controller_behavior | |
file_path = "app/controllers/curation_concerns/generic_works_controller.rb" | |
if File.exist?(file_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment