Zadanie 9
Interfejs graficzny
Treść zadania
Zmodyfikuj wszystkich autorów, tak by ich daty urodzenia i śmierci były poprawne. Popraw również imię i nazwisko Adama Mickiewicza. Aby wprowadzić datę skorzystaj z metody Date.parse.
Rozwiązanie zadania
author = Author.find(1)
author.update_attributes(name: "Adam", surname: "Mickiewicz", born: Date.parse('1798-12-24'), died: Date.parse('1855-11-26'))
author = Author.find(2)
author.update_attributes(born: Date.parse('1809-09-04'), died: Date.parse('1849-04-03'))
author = Author.find(3)
author.update_attributes(born: Date.parse('1846-05-05'), died: Date.parse('1916-11-05'))
author = Author.find(4)
author.update_attributes(born: Date.parse('1841-06-06'), died: Date.parse('1910-05-23'))
other_author = Author.find(4)
puts other_author.name
puts other_author.surname
puts other_author.born
puts other_author.died