Skip to content

Conversation

plural
Copy link
Contributor

@plural plural commented Sep 26, 2022

I am pretty happy with the view, but will wire up more pieces in the model and in the card API & query builder before declaring victory.

@plural plural changed the title First commit for a unified_card view & model. Replace Card Resource & API with a Unified Card backing view. Sep 26, 2022

def latest_printing_id
@model.printings.max_by { |p| p.date_release } ['id']
@model.printing_ids[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this now guaranteed to be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This caused me to look at the view definition again. I was sorting by printing id descending, but i changed to use date_release DESC instead. Results are the same, but it communicates the intent more clearly.

Since the view has the field sorted, taking the first will be correct.

'gains_subroutines' => 'unified_cards.gains_subroutines',
'h' => 'unified_cards.trash_cost',
'has_global_penalty' => 'unified_cards.restrictions_global_penalty',
'in_restriction' => 'unified_cards.in_restriction',
Copy link
Contributor

Choose a reason for hiding this comment

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

in_restriction appears to be either true or null, making it (I think) impossible to search for cards not in restrictions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ooh, good catch! Fixed.

@plural plural marked this pull request as ready for review October 22, 2022 20:57
@plural
Copy link
Contributor Author

plural commented Oct 22, 2022

Ok, i think this is in good shape for a review. I have a couple TODOs but we can deal with that later.

'side' => 'unified_cards.side_id',
'snapshot' => 'unified_cards.snapshot_ids',
'strength' => 'unified_cards.strength',
't' => 'unified_cards.card_type_id',
Copy link
Contributor

Choose a reason for hiding this comment

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

type:... and subtype:... are missing from the accepted syntax

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have card_type and card_subtype already, actually. I'd prefer to keep other syntax changes not related to the backing view change out of this PR, but let's revisit when i put the syntax doc page together. sg?

@plural
Copy link
Contributor Author

plural commented Oct 23, 2022

Thanks for taking a look! I went through and verified all the relationships to cards are updated and work.

@plural
Copy link
Contributor Author

plural commented Oct 23, 2022

oh, i have something still to do for card_pool and i'll fix the other 2 syntax issues you found.

@plural
Copy link
Contributor Author

plural commented Oct 23, 2022

actually, card_pool's issue was a local diff on my side, but the PR is good.

@plural plural merged commit fa4f774 into Null-Signal-Games:main Oct 24, 2022
@plural plural deleted the card_view branch October 24, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants