diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-11-03 01:56:16 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-11-03 01:56:16 +0530 |
commit | 3b0bb08699ce409b8213c82956dc34086dcbc8b9 (patch) | |
tree | 34398e3421fcfd86aab2b5fc757175dd2ce7664d /activerecord/lib/active_record/reflection.rb | |
parent | 974467d70d337d4c60414c792e275d367143217b (diff) | |
parent | ee917493e451e552fef18367f8bcba2f36080685 (diff) | |
download | rails-3b0bb08699ce409b8213c82956dc34086dcbc8b9.tar.gz rails-3b0bb08699ce409b8213c82956dc34086dcbc8b9.tar.bz2 rails-3b0bb08699ce409b8213c82956dc34086dcbc8b9.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
actionpack/lib/action_controller/metal/mime_responds.rb
activerecord/lib/active_record/attribute_methods.rb
guides/source/working_with_javascript_in_rails.md
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index f322b96f79..0103de4cbd 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -81,13 +81,13 @@ module ActiveRecord class MacroReflection # Returns the name of the macro. # - # <tt>composed_of :balance, :class_name => 'Money'</tt> returns <tt>:balance</tt> + # <tt>composed_of :balance, class_name: 'Money'</tt> returns <tt>:balance</tt> # <tt>has_many :clients</tt> returns <tt>:clients</tt> attr_reader :name # Returns the macro type. # - # <tt>composed_of :balance, :class_name => 'Money'</tt> returns <tt>:composed_of</tt> + # <tt>composed_of :balance, class_name: 'Money'</tt> returns <tt>:composed_of</tt> # <tt>has_many :clients</tt> returns <tt>:has_many</tt> attr_reader :macro @@ -95,7 +95,7 @@ module ActiveRecord # Returns the hash of options used for the macro. # - # <tt>composed_of :balance, :class_name => 'Money'</tt> returns <tt>{ :class_name => "Money" }</tt> + # <tt>composed_of :balance, class_name: 'Money'</tt> returns <tt>{ class_name: "Money" }</tt> # <tt>has_many :clients</tt> returns +{}+ attr_reader :options @@ -115,7 +115,7 @@ module ActiveRecord # Returns the class for the macro. # - # <tt>composed_of :balance, :class_name => 'Money'</tt> returns the Money class + # <tt>composed_of :balance, class_name: 'Money'</tt> returns the Money class # <tt>has_many :clients</tt> returns the Client class def klass @klass ||= class_name.constantize @@ -123,7 +123,7 @@ module ActiveRecord # Returns the class name for the macro. # - # <tt>composed_of :balance, :class_name => 'Money'</tt> returns <tt>'Money'</tt> + # <tt>composed_of :balance, class_name: 'Money'</tt> returns <tt>'Money'</tt> # <tt>has_many :clients</tt> returns <tt>'Client'</tt> def class_name @class_name ||= (options[:class_name] || derive_class_name).to_s @@ -315,10 +315,10 @@ module ActiveRecord # the parent's validation. # # Unless you explicitly disable validation with - # <tt>:validate => false</tt>, validation will take place when: + # <tt>validate: false</tt>, validation will take place when: # - # * you explicitly enable validation; <tt>:validate => true</tt> - # * you use autosave; <tt>:autosave => true</tt> + # * you explicitly enable validation; <tt>validate: true</tt> + # * you use autosave; <tt>autosave: true</tt> # * the association is a +has_many+ association def validate? !options[:validate].nil? ? options[:validate] : (options[:autosave] == true || macro == :has_many) @@ -399,7 +399,7 @@ module ActiveRecord # # class Post < ActiveRecord::Base # has_many :taggings - # has_many :tags, :through => :taggings + # has_many :tags, through: :taggings # end # def source_reflection @@ -411,7 +411,7 @@ module ActiveRecord # # class Post < ActiveRecord::Base # has_many :taggings - # has_many :tags, :through => :taggings + # has_many :tags, through: :taggings # end # # tags_reflection = Post.reflect_on_association(:tags) @@ -439,12 +439,12 @@ module ActiveRecord # # class Person # has_many :articles - # has_many :comment_tags, :through => :articles + # has_many :comment_tags, through: :articles # end # # class Article # has_many :comments - # has_many :comment_tags, :through => :comments, :source => :tags + # has_many :comment_tags, through: :comments, source: :tags # end # # class Comment |