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
4 changes: 2 additions & 2 deletions app/resources/api/v3/public/card_cycle_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Api::V3::Public::CardCycleResource < JSONAPI::Resource
caching
immutable

attributes :name, :date_release, :legacy_code, :card_set_ids, :first_printing_id, :released_by, :updated_at
attributes :name, :date_release, :legacy_code, :card_set_ids, :first_printing_id, :position, :released_by, :updated_at
key_type :string

has_many :card_sets
Expand All @@ -14,7 +14,7 @@ class Api::V3::Public::CardCycleResource < JSONAPI::Resource

paginator :none

filters :date_release, :legacy_code, :released_by
filters :date_release, :legacy_code, :position, :released_by

def first_printing_id
UnifiedPrinting.where(card_cycle_id: @model.id).minimum(:id)
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240128224447_add_position_to_card_cycle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPositionToCardCycle < ActiveRecord::Migration[7.0]
def change
add_column :card_cycles, :position, :integer
end
end
3 changes: 2 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: 2023_10_21_162540) do
ActiveRecord::Schema[7.0].define(version: 2024_01_28_224447) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand All @@ -23,6 +23,7 @@
t.date "date_release"
t.string "legacy_code"
t.string "released_by"
t.integer "position"
end

create_table "card_pools", id: :string, force: :cascade do |t|
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/cards.rake
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ namespace :cards do
id: c['id'],
name: c['name'],
legacy_code: c['legacy_code'],
position: c['position'],
released_by: c['released_by'],
}
end
Expand Down