&pgid;

**railsÊÙ¶¯²ñ°ìÍ÷ [#dd041670]
#ls2(rails)

**Âè4²óÊÙ¶¯²ñ¤Î¥Í¥¿ [#cdc3f5f5]

¥Í¥¿¤â¤È¤Ï²¼µ­¤Ç¤¹¡£

-RubyOnRails ¤ò»È¤Ã¤Æ¤ß¤ë ¡ÚÂè 3 ²ó¡Û ActiveRecord
http://jp.rubyist.net/magazine/?0006-RubyOnRails

-vendor/activerecord/README
¸¶Ê¸: http://api.rubyonrails.org/files/vendor/rails/activerecord/README.html
Ë®Ìõ: http://wiki.fdiary.net/rails/?ActiveRecord

-Active Record Reference Documentation
http://rubyonrails.org/api/classes/ActiveRecord/Base.html


**Æü»þ [#g4f8ac7b]
- 2006/08/11(¶â) 18:00¤¯¤é¤¤ ¡Á

**»²²Ã¼Ô [#u5cc1f6d]
-[[»ÖÅÄ]](ȯɽ¼Ô) ([[¥¢¡¼¥¯¥¦¥§¥Ö:http://www.ark-web.jp]])
-[[Ãݼ]]¤µ¤ó ([[¥¢¡¼¥¯¥¦¥§¥Ö:http://www.ark-web.jp]])
-[[¿ÊÃÏ]]¤µ¤ó ([[¥¢¡¼¥¯¥¦¥§¥Ö:http://www.ark-web.jp]])


** Æ°²è [#xcd2a900]

Æ°²è¤ÏÁ´Éô¤Ç3¤Ä¤Ç¤¹¡£~
³¤­¤Ï[[rails/Âè4²óÊÙ¶¯²ñ - Active Record Reference Documentation/Æ°²è]]¤Ë¤¢¤ê¤Þ¤¹¡£~

#blikimore

#htmlinsert(study/rails4-1.html)


** À¸À® [#b2cab7cf]
+¥Ï¥Ã¥·¥å¤Ç¡£
  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"

** Äɲäޤ¿¤Ï¹¹¿· [#q5539a36]
-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

** ¸¡º÷ [#y1199cdc]
-find¤äfind_by_sql ¥á¥½¥Ã¥É¤Ç¡£
http://rubyonrails.org/api/classes/ActiveRecord/Base.html#M000860
http://rubyonrails.org/api/classes/ActiveRecord/Base.html#M000861

** ºï½ü [#z7a7b5b1]
-delete
http://rubyonrails.org/api/classes/ActiveRecord/Base.html#M000865
-delete_all
-destory
 all the callbacks are the triggered
-destory_all

** update¤ò»È¤Ã¤¿¹¹¿· [#i74f7963]
-update
-update_all
-update_attribute

¥È¥Ã¥×   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

¥¢¡¼¥¯¥¦¥§¥Ö¤Î¥µ¡¼¥Ó¥¹¤ä¥½¥ê¥å¡¼¥·¥ç¥ó¤Ï¤³¤Á¤é