- バックアップ一覧
- ソース を表示
- Ruby on Rails/第4回勉強会 - Active Record Reference Documentation は削除されています。
- 1 (2006-08-11 (金) 14:46:20)
- 2 (2006-08-11 (金) 16:44:44)
- 3 (2006-08-17 (木) 11:02:02)
- 4 (2006-08-24 (木) 17:44:36)
- 5 (2006-10-03 (火) 16:43:09)
Ruby on Rails/第4回勉強会 - Active Record Reference Documentation?
rails勉強会一覧 †
'rails' には、下位層のページがありません。
第4回勉強会のネタ †
ネタもとは下記です。
Active Record Reference Documentation
http://rubyonrails.org/api/classes/ActiveRecord/Base.html
日時 †
- 2006/08/11(金) 18:00くらい 〜
参加者 †
生成 †
- ハッシュで。
user = User.new(:name => "David", :occupation => "Code Artist") user.name # => "David"
- blockで。
user = User.new do |u| u.name = "David" u.occupation = "Code Artist" end
- 空のオブジェクトをつくって。後から属性の設定。
user = User.new user.name = "David" user.occupation = "Code Artist"
保存 †
- saveまたは、save!メソッドで。
http://rubyonrails.org/api/classes/ActiveRecord/Base.html#M000905- No record exists: Creates a new record with values matching those of the object attributes.
- A record does exist: Updates the record with values matching those of the object attributes.
- save!は
it raises a RecordNotSaved exception