Browse files

Switch to 1.9 hash syntax

  • Loading branch information...
1 parent ba280c6 commit 000121e87e4e0a3912a2f5d4edfff7bbeb71078f @agis- agis- committed Nov 15, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 guides/source/
@@ -119,7 +119,7 @@ If you do so, you will have to define manually the class name that is hosting th
class FunnyJoke < ActiveSupport::TestCase
- set_fixture_class :funny_jokes => 'Joke'
+ set_fixture_class funny_jokes: 'Joke'
fixtures :funny_jokes
@@ -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:
- 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
# 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.

0 comments on commit 000121e

Please sign in to comment.