Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/resources/api/v3/public/card_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Api::V3::Public::CardResource < JSONAPI::Resource
attributes :card_subtype_ids, :display_subtypes, :attribution, :updated_at
attributes :format_ids, :card_pool_ids, :snapshot_ids, :card_cycle_ids, :card_set_ids
attributes :designed_by, :printings_released_by
attributes :pronouns

# Synthesized attributes
attributes :card_abilities, :latest_printing_id, :restrictions
Expand Down Expand Up @@ -53,7 +54,7 @@ def restrictions
filters :title, :card_type_id, :side_id, :faction_id, :advancement_requirement
filters :agenda_points, :base_link, :cost, :deck_limit, :influence_cost
filters :influence_limit, :memory_cost, :minimum_deck_size, :strength, :trash_cost, :is_unique
filters :designed_by
filters :designed_by, :pronouns

filter :search, apply: ->(records, value, _options) {
query_builder = CardSearchQueryBuilder.new(value[0])
Expand Down
5 changes: 3 additions & 2 deletions app/resources/api/v3/public/printing_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Api::V3::Public::PrintingResource < JSONAPI::Resource
attributes :title, :trash_cost, :printing_ids, :num_printings, :is_latest_printing, :restriction_ids, :in_restriction
attributes :format_ids, :card_pool_ids, :snapshot_ids
attributes :card_cycle_ids, :card_set_ids, :attribution
attributes :released_by, :printings_released_by, :designed_by
attributes :released_by, :printings_released_by, :designed_by, :pronouns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional, but consider adding a filter for it as well.


# Synthesized attributes
attributes :card_abilities, :images, :latest_printing_id, :restrictions
Expand Down Expand Up @@ -66,7 +66,8 @@ def restrictions
filters :title, :card_type_id, :side_id, :faction_id, :advancement_requirement
filters :agenda_points, :base_link, :cost, :deck_limit, :influence_cost, :influence_limit
filters :memory_cost, :minimum_deck_size, :strength, :trash_cost, :is_unique, :is_latest_printing

filters :pronouns

filter :search, apply: ->(records, value, _options) {
query_builder = PrintingSearchQueryBuilder.new(value[0])
if query_builder.parse_error.nil?
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240305053943_add_pronouns_to_cards.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPronounsToCards < ActiveRecord::Migration[7.1]
def change
add_column :cards, :pronouns, :string
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class UpdateUnifiedCardsToVersion5 < ActiveRecord::Migration[7.1]
def change

update_view :unified_cards,
version: 5,
revert_to_version: 4,
materialized: true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class UpdateUnifiedPrintingsToVersion7 < ActiveRecord::Migration[7.1]
def change

update_view :unified_printings,
version: 7,
revert_to_version: 6,
materialized: true
end
end
5 changes: 4 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2024_01_28_224447) do
ActiveRecord::Schema[7.1].define(version: 2024_03_06_072723) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -121,6 +121,7 @@
t.boolean "trash_ability", default: false
t.string "attribution"
t.string "designed_by"
t.string "pronouns"
t.index ["card_type_id"], name: "index_cards_on_card_type_id"
t.index ["faction_id"], name: "index_cards_on_faction_id"
t.index ["side_id"], name: "index_cards_on_side_id"
Expand Down Expand Up @@ -482,6 +483,7 @@
c.influence_limit,
c.memory_cost,
c.minimum_deck_size,
c.pronouns,
c.strength,
c.stripped_text,
c.text,
Expand Down Expand Up @@ -673,6 +675,7 @@
c.num_printed_subroutines,
c.on_encounter_effect,
c.performs_trace,
c.pronouns,
c.recurring_credits_provided,
c.side_id,
c.strength,
Expand Down
Loading