* add weapon_stat_modifiers table for ax skills and befoulments * add fk columns for ax modifiers and befoulments, replace has_ax_skills with augment_type * update models for weapon_stat_modifier fks and befoulments * update blueprints for weapon_stat_modifier serialization * update import service for weapon_stat_modifier fks and befoulments * add weapon_stat_modifiers controller and update params for fks * update tests and factories for weapon_stat_modifier fks * fix remaining has_ax_skills and ax_modifier references * add ax_modifier and befoulment_modifier to eager loading * fix ax modifier column naming and migration approach * add game_skill_ids for befoulment modifiers
21 lines
627 B
Ruby
21 lines
627 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class WeaponStatModifiersController < Api::V1::ApiController
|
|
# GET /weapon_stat_modifiers
|
|
def index
|
|
@modifiers = WeaponStatModifier.all
|
|
@modifiers = @modifiers.where(category: params[:category]) if params[:category].present?
|
|
|
|
render json: WeaponStatModifierBlueprint.render(@modifiers, root: :weapon_stat_modifiers)
|
|
end
|
|
|
|
# GET /weapon_stat_modifiers/:id
|
|
def show
|
|
@modifier = WeaponStatModifier.find(params[:id])
|
|
render json: WeaponStatModifierBlueprint.render(@modifier)
|
|
end
|
|
end
|
|
end
|
|
end
|