Commit c92861508773fd022c43b516a68d52ea3a0e7020

Authored by Leandro Santos
1 parent c4ed18dc

limit just for proposals

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
script/process_merit_rules.rb
... ... @@ -35,7 +35,8 @@ Merit.observers << 'ProcessObserver'
35 35  
36 36 class Article < ActiveRecord::Base
37 37 def self.text_article_types
38   - ['TextArticle', 'TextileArticle', 'TinyMceArticle', 'ProposalsDiscussionPlugin::Proposal']
  38 +# ['TextArticle', 'TextileArticle', 'TinyMceArticle', 'ProposalsDiscussionPlugin::Proposal']
  39 + ['ProposalsDiscussionPlugin::Proposal']
39 40 end
40 41 end
41 42  
... ... @@ -47,11 +48,11 @@ Environment.all.each do |environment|
47 48 Merit::AppPointRules.merge!(Merit::PointRules.new(environment).defined_rules)
48 49 Merit::AppBadgeRules.merge!(Merit::BadgeRules.new(environment).defined_rules)
49 50  
50   - article_count = environment.articles.where(:type => Article.text_article_types + ['ProposalsDiscussionPlugin::Proposal']).count
  51 + article_count = environment.articles.where(:type => Article.text_article_types).count
51 52 article_index = 0
52 53  
53 54 puts "Amount of articles '#{article_count}'"
54   - environment.articles.where(:type => Article.text_article_types + ['ProposalsDiscussionPlugin::Proposal']).find_each do |article|
  55 + environment.articles.where(:type => Article.text_article_types).find_each do |article|
55 56 article_index += 1
56 57 puts "Analising article #{article_index} of #{article_count}"
57 58 create_action(article, article_index, article_count)
... ...