aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_basics.md
diff options
context:
space:
mode:
authorAgis Anastasopoulos <corestudiosinc@gmail.com>2012-11-15 23:10:45 +0200
committerAgis Anastasopoulos <corestudiosinc@gmail.com>2012-11-15 23:10:45 +0200
commit000121e87e4e0a3912a2f5d4edfff7bbeb71078f (patch)
treed6ee283075f6f05f6c5254bf225733fa769d360d /guides/source/active_record_basics.md
parentba280c6ea1aae275756b8075ff34b39d085aaf8b (diff)
downloadrails-000121e87e4e0a3912a2f5d4edfff7bbeb71078f.tar.gz
rails-000121e87e4e0a3912a2f5d4edfff7bbeb71078f.tar.bz2
rails-000121e87e4e0a3912a2f5d4edfff7bbeb71078f.zip
Switch to 1.9 hash syntax
Diffstat (limited to 'guides/source/active_record_basics.md')
-rw-r--r--guides/source/active_record_basics.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md
index 5bc100f326..810a0263c0 100644
--- a/guides/source/active_record_basics.md
+++ b/guides/source/active_record_basics.md
@@ -119,7 +119,7 @@ If you do so, you will have to define manually the class name that is hosting th
```ruby
class FunnyJoke < ActiveSupport::TestCase
- set_fixture_class :funny_jokes => 'Joke'
+ set_fixture_class funny_jokes: 'Joke'
fixtures :funny_jokes
...
end
@@ -145,7 +145,7 @@ Active Record objects can be created from a hash, a block or have their attribut
For example, given a model `User` with attributes of `name` and `occupation`, the `create` method call will create and save a new record into the database:
```ruby
- user = User.create(:name => "David", :occupation => "Code Artist")
+ user = User.create(name: "David", occupation: "Code Artist")
```
Using the `new` method, an object can be created without being saved:
@@ -188,7 +188,7 @@ Active Record provides a rich API for accessing data within a database. Below ar
```ruby
# find all users named David who are Code Artists and sort by created_at in reverse chronological order
- users = User.where(:name => 'David', :occupation => 'Code Artist').order('created_at DESC')
+ users = User.where(name: 'David', occupation: 'Code Artist').order('created_at DESC')
```
You can learn more about querying an Active Record model in the [Active Record Query Interface](active_record_querying.html) guide.