Created
October 17, 2016 13:43
-
-
Save thomasmarren/6a71b79c4a759d6d96c61d9bb7a8b031 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
#Ruby | |
class User | |
def initialize (id = nil, name, grade) | |
self.name = name | |
self.grade = grade | |
@@all << self | |
end | |
def self.all | |
@all | |
end | |
end | |
User.all | |
#Active Record | |
users = User.all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment