Skip to content

Instantly share code, notes, and snippets.

@austinbv
Created March 29, 2012 02:40
Show Gist options
  • Save austinbv/2232694 to your computer and use it in GitHub Desktop.
Save austinbv/2232694 to your computer and use it in GitHub Desktop.
class Deck < ActiveRecord::Base
def show_card
# Why assign to an instance var???
deck.first
end
def create_deck
# again why are you assigning
# also arrays have a destructive shuffle method
#
deck = (1..54).to_a.shuffle!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment