diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-03-24 17:15:10 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-03-24 17:15:10 +0530 |
commit | 014498e1d74decd57d44d45c187fa4f4b968b811 (patch) | |
tree | 948610d910d28fc976cdffffd533879a16b01557 /activerecord/lib/active_record | |
parent | 780ab582091cf06ded9540a5d4fef23086e9bac3 (diff) | |
parent | 2fab826db055f7b59bb83b834d730d69c8c7b25e (diff) | |
download | rails-014498e1d74decd57d44d45c187fa4f4b968b811.tar.gz rails-014498e1d74decd57d44d45c187fa4f4b968b811.tar.bz2 rails-014498e1d74decd57d44d45c187fa4f4b968b811.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
guides/source/ruby_on_rails_guides_guidelines.textile
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/inheritance.rb | 14 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb index ebe244c6a6..46d253b0a7 100644 --- a/activerecord/lib/active_record/inheritance.rb +++ b/activerecord/lib/active_record/inheritance.rb @@ -48,6 +48,20 @@ module ActiveRecord end # Set this to true if this is an abstract class (see <tt>abstract_class?</tt>). + # If you are using inheritance with ActiveRecord and don't want child classes + # to utilize the implied STI table name of the parent class, this will need to be true. + # For example, given the following: + # + # class SuperClass < ActiveRecord::Base + # self.abstract_class = true + # end + # class Child < SuperClass + # self.table_name = 'the_table_i_really_want' + # end + # + # + # <tt>self.abstract_class = true</tt> is required to make <tt>Child<.find,.create, or any Arel method></tt> use <tt>the_table_i_really_want</tt> instead of a table called <tt>super_classes</tt> + # attr_accessor :abstract_class # Returns whether this class is an abstract class or not. diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index ae2dc6872a..b125449127 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -256,7 +256,7 @@ module ActiveRecord # # Update all books with 'Rails' in their title # Book.update_all "author = 'David'", "title LIKE '%Rails%'" # - # # Update all avatars migrated more than a week ago + # # Update all avatars migrated more recently than a week ago # Avatar.update_all ['migrated_at = ?', Time.now.utc], ['migrated_at > ?', 1.week.ago] # # # Update all books that match conditions, but limit it to 5 ordered by date |