Skip to content

Commit

Permalink
refreshed slides for 3rd meetup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomash committed Apr 26, 2012
1 parent 13383e3 commit 16b2e9e
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 45 deletions.
25 changes: 25 additions & 0 deletions 3/showoff/active_model/slide.md
@@ -0,0 +1,25 @@
!SLIDE title-slide

# ActiveModel

### "Make Any Ruby Object Feel Like ActiveRecord"


!SLIDE bullets

# ActiveModel w pigułce

* od Rails 3 wyciągnięty z ActiveRecord
* dostępne dla każdej klasy Ruby (nie tylko ORMy)
* validations, callbacks
* serialization, dirty, observing


!SLIDE

# ActiveModel::Validations


!SLIDE

# ActiveModel::Callbacks
Expand Up @@ -32,41 +32,41 @@
# konwencje w AR

* klasa o nazwie w CamelCase
* tabela w bazie our_object*s*
* tabela w bazie our\_object*s*
* klucz główny: id
* klucz w innych tabelach: object_id
* klucz obcy: object\_id
* **wszystko można nadpisać**


!SLIDE bullets incremental

# tworzenie i edycja rekordów

* Klasa.new
* Model.new
* obj#attributes, obj#pole, obj#pole=
* obj#save vs. obj#save!
* Klasa.create
* Model.create
* obj#destroy


!SLIDE bullets incremental

# wyszukiwanie

* .find - jedna metoda by wszystko odnaleźć
* .find(id), find(:first), .find(:all), parametry
* .find(id) - jeden wiersz
* .where(warunki)
* .where(warunki).order, method chains
* dynamic finders: find_by_title
* adaptive finders: find_or_create_by_title


!SLIDE bullets
!SLIDE bullets incremental

# łatwe deklarowanie relacji

* belongs_to :something
* has_one oraz has_many
* has_and_belongs_to_many
* has_many :through
* belongs\_to :something
* has\_one, has\_many
* has\_and\_belongs\_to\_many
* has\_many :through


!SLIDE bullets
Expand Down
18 changes: 7 additions & 11 deletions 3/showoff/intro/slide.md
@@ -1,22 +1,18 @@
!SLIDE title-slide

# Rails -- podstawy
## część pierwsza:
# Ruby On Rails:
# ActiveRecord
## i warstwa Modelu w RoR
### Tomek "Tomash" Stachewicz
#### Szkolenie Ruby On Rails, 2010-03-30
#### Szkolenie Ruby On Rails, 2012-04-26

!SLIDE numbered

# Rozkład Jazdy
## Rozkład jazdy w dużym skrócie

1. Wstęp
2. Podstawy Ruby
3. **Ruby On Rails - podstawy część 1**
4. Ruby On Rails - podstawy część 2
5. Autentykacja, filtry, pluginy, biblioteki
6. Helpery, AJAX, Prototype

7. REST
8. ???
3. <u>Ruby On Rails - ActiveRecord</u>
4. RoR - kontrolery, widoki
5. Autentykacja, filtry, gemy, biblioteki
6. Helpery, Javascript
8 changes: 4 additions & 4 deletions 3/showoff/migrations/slide.md
Expand Up @@ -19,13 +19,13 @@

## Podstawowe narzędzie Ruby On Rails do zarządzania ewolucją struktury bazy danych w miarę rozwoju aplikacji.

!SLIDE smbullets
!SLIDE smbullets

# Struktura migracji

* skrypty Ruby, z klasą < ActiveRecord::Migration
* Dwie metody: up i down
* Podstawowe metody: create table, add_column, remove_column, rename_column
* pliki Ruby, z klasą < ActiveRecord::Migration
* Dwie metody: up i down, ew. change
* Podstawowe metody: create\_table, add\_column, remove\_column
* Podstawowe typy danych: :integer, :string, :text, :float, :decimal, :datetime, :boolean

!SLIDE
Expand Down
8 changes: 4 additions & 4 deletions 3/showoff/outro/slide.md
@@ -1,11 +1,11 @@
!SLIDE

# pomysły relacji w ToDo
# pomysły relacji w Blogu

## Priorytet
### Priority has_many :tasks, Task belongs_to :priority
## Komentarz
### Post has\_many :comments, Comment belongs\_to :post

## Miejsce
## Tagi
### HABTM czy HMT?


Expand Down
3 changes: 2 additions & 1 deletion 3/showoff/showoff.json
@@ -1,6 +1,7 @@
[
{"section":"intro"},
{"section":"migrations"},
{"section":"active_record_1"},
{"section":"active_record"},
{"section":"active_model"},
{"section":"outro"}
]
24 changes: 11 additions & 13 deletions 3/showoff/tomash.css
@@ -1,3 +1,14 @@
div.slide {

background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.11, rgb(255,255,255)),
color-stop(1, rgb(220,220,220))
);
}

.title-slide img,
.left-img img
{
Expand All @@ -24,16 +35,3 @@ pre {
text-align: right;
font-size: 2em;
}

ol {
list-style: decimal;
}

.numbered ol {
font-size: 2.5em;
list-style: decimal;
}
.numbered ol li {
text-align: left;
padding: 15px;
}

0 comments on commit 16b2e9e

Please sign in to comment.