summaryrefslogtreecommitdiff
path: root/app/controllers/characters/spells_controller.rb
blob: b98c1c35f74ee847721abd187237336544d1fc59 (plain)
1
2
3
4
5
6
7
8
9
10
11
class Characters::SpellsController < ApplicationController
  def index
    @spell_activities = Activity.where("gid like ?", "havencast_%")
                                .or(Activity.where("gid like ?", "worldcall_%"))
                                .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