From 199bb5958aec6a1b301ebe5ef7316d6086424e3c Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 12 May 2019 02:48:32 -0500 Subject: [PATCH 1/4] force dyno restart --- README.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rdoc b/README.rdoc index 3051b7d1..890fcb1c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,4 +1,4 @@ -= Notebook.ai += Notebook.ai {Build Status}[https://travis-ci.org/indentlabs/notebook] {}[https://codeclimate.com/github/indentlabs/notebook] {}[https://codeclimate.com/github/indentlabs/notebook/coverage] From 175038c10c4e93e1345e38484bc1609fba0ff2fe Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 12 May 2019 02:54:56 -0500 Subject: [PATCH 2/4] fix 500 when focused to universe --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b0276023..b1649753 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base end def cache_linkable_content_for_each_content_type - linkable_classes = Rails.application.config.content_types[:all].map(&:name) & current_user.user_content_type_activators.pluck(:content_type) + linkable_classes = Rails.application.config.content_types[:all_non_universe].map(&:name) & current_user.user_content_type_activators.pluck(:content_type) @linkables_cache = {} linkable_classes.each do |class_name| From 612809e517afaff3ee95cc85b266f5a8dca649fc Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 12 May 2019 02:59:18 -0500 Subject: [PATCH 3/4] Re-enable linking to universes --- app/controllers/application_controller.rb | 2 +- app/models/content_types/universe.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b1649753..b0276023 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base end def cache_linkable_content_for_each_content_type - linkable_classes = Rails.application.config.content_types[:all_non_universe].map(&:name) & current_user.user_content_type_activators.pluck(:content_type) + linkable_classes = Rails.application.config.content_types[:all].map(&:name) & current_user.user_content_type_activators.pluck(:content_type) @linkables_cache = {} linkable_classes.each do |class_name| diff --git a/app/models/content_types/universe.rb b/app/models/content_types/universe.rb index 59ab6759..85823017 100644 --- a/app/models/content_types/universe.rb +++ b/app/models/content_types/universe.rb @@ -49,7 +49,7 @@ class Universe < ApplicationRecord has_many :contributors, dependent: :destroy - scope :in_universe, ->(universe = nil) { where(universe: self) unless universe.nil? } + scope :in_universe, ->(universe = nil) { where(id: universe.try(:id)) unless universe.nil? } after_destroy do Rails.application.config.content_types[:all_non_universe].each do |content_type| From 9cfac979699ea271c305a35fbb272108c87ffb8b Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 12 May 2019 21:45:46 -0500 Subject: [PATCH 4/4] fix tests --- spec/controllers/subscriptions_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/subscriptions_controller_spec.rb b/spec/controllers/subscriptions_controller_spec.rb index cbc7f59f..35780d1c 100644 --- a/spec/controllers/subscriptions_controller_spec.rb +++ b/spec/controllers/subscriptions_controller_spec.rb @@ -144,7 +144,7 @@ RSpec.describe SubscriptionsController, type: :controller do ) expect(@user.selected_billing_plan_id).to eq(@free_plan.id) - expect(@user.active_billing_plans).to eq([@free_plan]) + expect(@user.active_billing_plans).not_to eq([@premium_plan]) post :change, params: { stripe_plan_id: 'premium' } @@ -155,7 +155,7 @@ RSpec.describe SubscriptionsController, type: :controller do describe "Starter Permissions" do before do - @user.update(selected_billing_plan_id: @premium_plan.id) + @user.update(selected_billing_plan_id: @free_plan.id) end it "allows Starter users to create core content types" do