find
to loop and find the record when the looping can be done in the class method? Wouldn't you be able to something like attached below?class << self def find(id) return unless id new(USERS.find { |user| user[:id] == id }) end end
@resource.errors.full_messages
so that I get an array of strings in human readable sentence.def generate_token while self.class.exists?(token: token) self.token = SecureRandom.hex(8) end end