aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-05-17 02:40:15 +0430
committerRizwan Reza <rizwanreza@gmail.com>2010-05-17 02:40:15 +0430
commitd148a6f6ba5f8ee65905f12cd2601fcc377d4852 (patch)
tree4bcb5e7ad47cfb9a9bb14ffe7c9e003d4646d64c /railties/guides/source
parente1c773006969abea3c0619fbdc7e32c121b6085f (diff)
parent6b4e0cc526f55b5532cf99292c94f0a4db53b16f (diff)
downloadrails-d148a6f6ba5f8ee65905f12cd2601fcc377d4852.tar.gz
rails-d148a6f6ba5f8ee65905f12cd2601fcc377d4852.tar.bz2
rails-d148a6f6ba5f8ee65905f12cd2601fcc377d4852.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/active_record_basics.textile10
-rw-r--r--railties/guides/source/active_support_core_extensions.textile22
-rw-r--r--railties/guides/source/initialization.textile2
3 files changed, 22 insertions, 12 deletions
diff --git a/railties/guides/source/active_record_basics.textile b/railties/guides/source/active_record_basics.textile
index 226f1b134b..d81e461e63 100644
--- a/railties/guides/source/active_record_basics.textile
+++ b/railties/guides/source/active_record_basics.textile
@@ -104,6 +104,14 @@ class Product < ActiveRecord::Base
set_table_name "PRODUCT"
end
</ruby>
+If you do so, you will have to define manually the class name that is hosting the fixtures (class_name.yml) using the +set_fixture_class+ method in your test definition:
+<ruby>
+class FunnyJoke < ActiveSupport::TestCase
+ set_fixture_class :funny_jokes => 'Joke'
+ fixtures :funny_jokes
+ ...
+end
+</ruby>
It's also possible to override the column that should be used as the table's primary key. Use the +ActiveRecord::Base.set_primary_key+ method for that:
<ruby>
@@ -201,4 +209,4 @@ Active Record callbacks allow you to attach code to certain events in the life-c
h3. Migrations
-Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record support using rake. Rails keeps track of which files have been committed to the database and provides rollback features. You can learn more about migrations in the "Active Record Migrations guide":migrations.html \ No newline at end of file
+Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record support using rake. Rails keeps track of which files have been committed to the database and provides rollback features. You can learn more about migrations in the "Active Record Migrations guide":migrations.html
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index 72194e567a..08fddd2926 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -2660,13 +2660,13 @@ Active Support defines +Date.current+ to be today in the current time zone. That
h5. Named dates
-h6. +last_year+, +next_year+
+h6. +prev_year+, +next_year+
-The methods +last_year+ and +next_year+ return a date with the same day/month in the last or next year:
+In Ruby 1.9 +prev_year+ and +next_year+ return a date with the same day/month in the last or next year:
<ruby>
d = Date.new(2010, 5, 8) # => Sat, 08 May 2010
-d.last_year # => Fri, 08 May 2009
+d.prev_year # => Fri, 08 May 2009
d.next_year # => Sun, 08 May 2011
</ruby>
@@ -2674,29 +2674,33 @@ If date is the 29th of February of a leap year, you obtain the 28th:
<ruby>
d = Date.new(2000, 2, 29) # => Tue, 29 Feb 2000
-d.last_year # => Sun, 28 Feb 1999
+d.prev_year # => Sun, 28 Feb 1999
d.next_year # => Wed, 28 Feb 2001
</ruby>
-h6. +last_month+, +next_month+
+Active Support defines these methods as well for Ruby 1.8.
-The methods +last_month+ and +next_month+ return the date with the same day in the last or next month:
+h6. +prev_month+, +next_month+
+
+In Ruby 1.9 +prev_month+ and +next_month+ return the date with the same day in the last or next month:
<ruby>
d = Date.new(2010, 5, 8) # => Sat, 08 May 2010
-d.last_month # => Thu, 08 Apr 2010
+d.prev_month # => Thu, 08 Apr 2010
d.next_month # => Tue, 08 Jun 2010
</ruby>
If such a day does not exist, the last day of the corresponding month is returned:
<ruby>
-Date.new(2000, 5, 31).last_month # => Sun, 30 Apr 2000
-Date.new(2000, 3, 31).last_month # => Tue, 29 Feb 2000
+Date.new(2000, 5, 31).prev_month # => Sun, 30 Apr 2000
+Date.new(2000, 3, 31).prev_month # => Tue, 29 Feb 2000
Date.new(2000, 5, 31).next_month # => Fri, 30 Jun 2000
Date.new(2000, 1, 31).next_month # => Tue, 29 Feb 2000
</ruby>
+Active Support defines these methods as well for Ruby 1.8.
+
h6. +beginning_of_week+, +end_of_week+
The methods +beginning_of_week+ and +end_of_week+ return the dates for the beginning and end of week, assuming weeks start on Monday:
diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile
index 9ce27fa331..96d6998e1c 100644
--- a/railties/guides/source/initialization.textile
+++ b/railties/guides/source/initialization.textile
@@ -2379,7 +2379,6 @@ Now that we've referenced that class, it will be required for us. You'll notice
* initialize_subscriber
* set_clear_dependencies_hook
* initialize_dependency_mechanism
-* bootstrap_load_path
These are all defined using the +initializer+ method:
@@ -2930,7 +2929,6 @@ With +@@autoloads+ being
* initialize_subscriber
* set_clear_dependencies_hook
* initialize_dependency_mechanism
-* bootstrap_load_path
h4. Active Support Initializers