From 361acfad2162e08a962c63c4443641fbbd812089 Mon Sep 17 00:00:00 2001 From: David Gay Date: Wed, 16 Jun 2021 19:20:17 -0400 Subject: Learn spells from spellpages --- app/controllers/characters/spells_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/characters/spells_controller.rb b/app/controllers/characters/spells_controller.rb index 9694856..a0e6913 100644 --- a/app/controllers/characters/spells_controller.rb +++ b/app/controllers/characters/spells_controller.rb @@ -1,5 +1,9 @@ class Characters::SpellsController < ApplicationController def index - @spell_activities = Activity.where("gid like ?", "havencast_%").order(:name) + @spell_activities = Activity.where("gid like ?", "havencast_%").where(innate: true).order(:name) + # TODO: Don't load into memory + @spell_activities = @spell_activities.to_a + current_char.learned_activities + .map { |la| la.activity } + .select { |a| a.gid.start_with?("havencast_") } end end -- cgit v1.2.3