active record find info about one row code example
Example: self.find_by_id
def self.find_by_id(id)
sql = <<-SQL
SELECT * FROM dogs WHERE id = ?
SQL
DB[:conn].execute(sql, id).map(){|row|
self.new_from_db(row)
}.first
end