aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/README.rdoc
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-17 00:28:05 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-17 00:28:05 -0500
commit82355dfb35c8bc2eeb29ccfa48b5a85e5e4ba687 (patch)
tree653459883c308489f6235cbb7377f3333ad74674 /activerecord/README.rdoc
parentd71d5ba71fadf4219c466c0332f78f6e325bcc6c (diff)
downloadrails-82355dfb35c8bc2eeb29ccfa48b5a85e5e4ba687.tar.gz
rails-82355dfb35c8bc2eeb29ccfa48b5a85e5e4ba687.tar.bz2
rails-82355dfb35c8bc2eeb29ccfa48b5a85e5e4ba687.zip
update code examples to 1.9 hash syntax in the AR/README [ci skip]
Diffstat (limited to 'activerecord/README.rdoc')
-rw-r--r--activerecord/README.rdoc24
1 files changed, 12 insertions, 12 deletions
diff --git a/activerecord/README.rdoc b/activerecord/README.rdoc
index d080e0b0f5..cc8942809c 100644
--- a/activerecord/README.rdoc
+++ b/activerecord/README.rdoc
@@ -49,10 +49,10 @@ A short rundown of some of the major features:
* Aggregations of value objects.
class Account < ActiveRecord::Base
- composed_of :balance, :class_name => "Money",
- :mapping => %w(balance amount)
+ composed_of :balance, class_name: 'Money',
+ mapping: %w(balance amount)
composed_of :address,
- :mapping => [%w(address_street street), %w(address_city city)]
+ mapping: [%w(address_street street), %w(address_city city)]
end
{Learn more}[link:classes/ActiveRecord/Aggregations/ClassMethods.html]
@@ -84,7 +84,7 @@ A short rundown of some of the major features:
class CommentObserver < ActiveRecord::Observer
def after_create(comment) # is called just after Comment#save
- CommentMailer.new_comment_email("david@loudthinking.com", comment).deliver
+ CommentMailer.new_comment_email('david@loudthinking.com', comment).deliver
end
end
@@ -124,15 +124,15 @@ A short rundown of some of the major features:
* Database abstraction through simple adapters.
# connect to SQLite3
- ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "dbfile.sqlite3")
+ ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: 'dbfile.sqlite3')
# connect to MySQL with authentication
ActiveRecord::Base.establish_connection(
- :adapter => "mysql2",
- :host => "localhost",
- :username => "me",
- :password => "secret",
- :database => "activerecord"
+ adapter: 'mysql2',
+ host: 'localhost',
+ username: 'me',
+ password: 'secret',
+ database: 'activerecord'
)
{Learn more}[link:classes/ActiveRecord/Base.html] and read about the built-in support for
@@ -144,7 +144,7 @@ A short rundown of some of the major features:
* Logging support for Log4r[http://log4r.sourceforge.net] and Logger[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc].
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
- ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
+ ActiveRecord::Base.logger = Log4r::Logger.new('Application Log')
* Database agnostic schema management with Migrations.
@@ -159,7 +159,7 @@ A short rundown of some of the major features:
t.integer :position
end
- SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1
+ SystemSetting.create name: 'notice', label: 'Use notice?', value: 1
end
def down