From d0f2b4c0fa6c9594478c8d7f60092448929c92cf Mon Sep 17 00:00:00 2001 From: Michael Pelletier Date: Thu, 31 Mar 2016 07:54:56 -0400 Subject: [PATCH] Missed this during a gross merge conflict. --- app/controllers/api/api_controller.rb | 6 +++--- app/models/game.rb | 1 - app/models/tweet.rb | 4 +--- config/application.rb | 2 +- config/environments/production.rb | 2 +- db/schema.rb | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/controllers/api/api_controller.rb b/app/controllers/api/api_controller.rb index a867c97..d732546 100644 --- a/app/controllers/api/api_controller.rb +++ b/app/controllers/api/api_controller.rb @@ -39,13 +39,13 @@ def dashboard() end begin - current_income_list = Income.where(round: round).pluck(:team_name, :amount) - previous_income_list = Income.where(round: (round -1)).pluck_to_hash(:team_name, :amount).group_by{|x| x[:team_name]} + current_income_list = @games.incomes.where(round: round).pluck(:team_name, :amount) + previous_income_list = @games.incomes.where(round: (round -1)).pluck_to_hash(:team_name, :amount).group_by{|x| x[:team_name]} countries_data = current_income_list.map do |country, amount| previous_income = previous_income_list[country] - income_change = if previous_income.empty? + income_change = if previous_income.nil? or previous_income.empty? amount else amount - previous_income[0][:amount] diff --git a/app/models/game.rb b/app/models/game.rb index d65b5c1..bae6294 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -41,7 +41,6 @@ def update() self.round +=1 self.next_round = self.next_round + (30*60) self.save - #Group Twitter activities together and dump cleanly into the error bucket on fail begin Tweet.import diff --git a/app/models/tweet.rb b/app/models/tweet.rb index b75e076..37012a7 100644 --- a/app/models/tweet.rb +++ b/app/models/tweet.rb @@ -5,9 +5,7 @@ class Tweet < ActiveRecord::Base def publish(client) require 'open-uri' - # if self.is_public && !self.is_published - # Disble tweeting - if false + if self.is_public && !self.is_published # Need to add source + char, limit. # GNN: # DEN: diff --git a/config/application.rb b/config/application.rb index f3952ce..cfb294e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -19,7 +19,7 @@ class Application < Rails::Application # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de config.assets.paths << Rails.root.join('vendor', 'assets', 'components') - config.time_zone = 'Central Time (US & Canada)' + config.time_zone = 'Eastern Time (US & Canada)' config.active_record.default_timezone = :local config.serve_static_files = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 98f5a2c..4f24655 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -87,6 +87,6 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - config.time_zone = "Pacific Time (US & Canada)" + config.time_zone = 'Eastern Time (US & Canada)' config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/ end diff --git a/db/schema.rb b/db/schema.rb index e80b987..ee791c1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160228112423) do +ActiveRecord::Schema.define(version: 20160320220659) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"