-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rb
More file actions
35 lines (28 loc) · 827 Bytes
/
test.rb
File metadata and controls
35 lines (28 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require_relative "app"
# p Student.first_n[:first_name]
# p Cohort.find 1
# p Student.name
# ramons = Student.where('first_name = ?', 'Maximo')
# p ramons
# p Student.new(id...sad)
# cohort = Cohort.find(1)
# p cohort[:name] = "Best Cohort Evver"
# cohort.save
# Cohort.create({:name => "Nove"})
# p Student.create(:cohort_id => 4,
# :first_name => "Petr",
# :last_name => "Duda",
# :email => "Peta@Duda.cz",
# :gender => "male" )
# p Student.all
# ===========WHERE===========
# p ahoj = Student.where("last_name=?", "Duda")
# execute("SELECT * FROM students WHERE id=? AND first_name = ?", "10", "duda")
# p Student.where("id=?", "5")
# p Cohort.where("id=?", "5")
# ===========WHERE===========
# p Cohort.find(1)[:name] == "Best Cohort Ever"
#
# student = Student
# student.update!
# p Student.find(5)