SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 41 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

new
newacc.Username = "Kevin"
newacc.Password = "Marshall"
newacc.save
# creates an Account object in memory from data in Account table with ID of 1
# (equivalent to the ANSI SQL statement of "select * from accounts where ID = 1")
findacc = Account.find(1)
# deletes records from database that have username of "Kevin"
Account.delete("username = 'Kevin'")
Don??™t worry if all this sort of seems like magic at this point??”right now, we??™re simply trying
to show you the ORM concept without any clutter. We??™ll dive into the details of all this stuff and
explain all the ins and outs of Active Record syntax in later chapters.
Active Record Is a Different Kind of ORM
Active Record differs from other ORM libraries, such as Java??™s Hibernate, mostly in the way it??™s
configured or, rather, in the general lack of initial configuration it requires. Out of the box,
Active Record makes a number of configuration assumptions, without requiring any outside
XML configuration files or mapping details, so nearly everything just works as DHH believed
most would expect or want it to??”in fact, our previous example showed this was the case and
took full advantage of Active Record assumptions.


Pages:
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6