-
-
Save glinesbdev/5c1a58edc22bfc4030ba3d330bd5a454 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
card = Card.first # as an example | |
card.card_set_id = CardSet.find_by(:name => card.set).id | |
card.save | |
# => ActiveRecord::RecordInvalid: Validation failed: Card set must exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> #<Card id: 1, card_id: "xy5-15", name: "Shroomish", national_pokedex_number: 285, image_url: "https://images.pokemontcg.io/xy5/15.png", image_url_hi_res: "https://images.pokemontcg.io/xy5/15_hires.png", subtype: "Basic", supertype: "Pokémon", evolves_from: nil, hp: "60", number: "15", artist: "Mizue", rarity: "Common", series: "XY", set: "Primal Clash", set_code: "xy5", text: nil, created_at: "2017-04-24 13:52:01", updated_at: "2017-04-24 13:52:01", card_set_id: nil> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment