From 2a09b8ecc7df94db28dbcaff43ce0c5cdd5acfdc Mon Sep 17 00:00:00 2001 From: Joe Hannon Date: Sun, 2 May 2010 15:55:58 -0700 Subject: grammatical error 'uses' -> 'use' --- railties/guides/source/active_record_querying.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index e47615f070..1cfec1cf77 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -17,7 +17,7 @@ If you're used to using raw SQL to find database records then, generally, you wi Code examples throughout this guide will refer to one or more of the following models: -TIP: All of the following models uses +id+ as the primary key, unless specified otherwise. +TIP: All of the following models use +id+ as the primary key, unless specified otherwise.
-- cgit v1.2.3 From 6658c958972da2c56f2be9001fe22c8f2875ba3c Mon Sep 17 00:00:00 2001 From: logylaps Date: Tue, 4 May 2010 02:17:36 -0700 Subject: typo 'main.cs' -> 'main.css' --- railties/guides/source/layouts_and_rendering.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 92b36ab3e4..f6b6a1a7cc 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -747,7 +747,7 @@ You can even use dynamic paths such as +cache/#{current_site}/main/display+. h5. Linking to CSS Files with +stylesheet_link_tag+ -The +stylesheet_link_tag+ helper returns an HTML +<link>+ tag for each source provided. Rails looks in +public/stylesheets+ for these files by default, but you can specify a full path relative to the document root, or a URL, if you prefer. For example, to include +public/stylesheets/main.cs+: +The +stylesheet_link_tag+ helper returns an HTML +<link>+ tag for each source provided. Rails looks in +public/stylesheets+ for these files by default, but you can specify a full path relative to the document root, or a URL, if you prefer. For example, to include +public/stylesheets/main.css+: <%= stylesheet_link_tag "main" %> -- cgit v1.2.3 From 387e16afa905eff2943a94d08a471d402404eb78 Mon Sep 17 00:00:00 2001 From: logylaps Date: Tue, 4 May 2010 02:23:49 -0700 Subject: textile typo 'h6(:has_many-group)' -> 'h6(#has_many-group)' --- railties/guides/source/association_basics.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/association_basics.textile b/railties/guides/source/association_basics.textile index f13f6db6ee..335d17579d 100644 --- a/railties/guides/source/association_basics.textile +++ b/railties/guides/source/association_basics.textile @@ -1262,7 +1262,7 @@ end TIP: In any case, Rails will not create foreign key columns for you. You need to explicitly define them as part of your migrations. -h6(:has_many-group). +:group+ +h6(#has_many-group). +:group+ The +:group+ option supplies an attribute name to group the result set by, using a +GROUP BY+ clause in the finder SQL. -- cgit v1.2.3 From 8770b8c955c599282fd3257e2f1a4deaed9230e8 Mon Sep 17 00:00:00 2001 From: logylaps Date: Tue, 4 May 2010 02:25:55 -0700 Subject: typo. missing 'if' --- railties/guides/source/active_record_querying.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 1cfec1cf77..e18dbc9c42 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -802,7 +802,7 @@ will either assign an existing client object with the name "Ryan" to the client h3. Finding by SQL -If you'd like to use your own SQL to find records in a table you can use +find_by_sql+. The +find_by_sql+ method will return an array of objects even the underlying query returns just a single record. For example you could run this query: +If you'd like to use your own SQL to find records in a table you can use +find_by_sql+. The +find_by_sql+ method will return an array of objects even if the underlying query returns just a single record. For example you could run this query: Client.find_by_sql("SELECT * FROM clients -- cgit v1.2.3 From 1357b659bbcb0fbc7c559da536af76d164f147b5 Mon Sep 17 00:00:00 2001 From: mica eked Date: Tue, 4 May 2010 02:46:21 -0700 Subject: typo "" -> "" --- railties/guides/source/layouts_and_rendering.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index f6b6a1a7cc..11d7ed0a3c 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -806,7 +806,7 @@ You can even use dynamic paths such as +cache/#{current_site}/main/display+. h5. Linking to Images with +image_tag+ -The +image_tag+ helper builds an HTML +<image />+ tag to the specified file. By default, files are loaded from +public/images+, note, you must specify the extension, previous versions of Rails would allow you to just call the image name and would append +.png+ if no extension was given, Rails 3.0 does not. +The +image_tag+ helper builds an HTML +<img />+ tag to the specified file. By default, files are loaded from +public/images+, note, you must specify the extension, previous versions of Rails would allow you to just call the image name and would append +.png+ if no extension was given, Rails 3.0 does not. <%= image_tag "header.png" %> -- cgit v1.2.3 From 3190fcb5216851d64f709ab6cf3fe468558f1020 Mon Sep 17 00:00:00 2001 From: mica eked Date: Tue, 4 May 2010 03:10:41 -0700 Subject: typo 'follow' -> 'following' --- railties/guides/source/layouts_and_rendering.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 11d7ed0a3c..7be369453e 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -1154,7 +1154,7 @@ h4. Using Nested Layouts You may find that your application requires a layout that differs slightly from your regular application layout to support one particular controller. Rather than repeating the main layout and editing it, you can accomplish this by using nested layouts (sometimes called sub-templates). Here's an example: -Suppose you have the follow +ApplicationController+ layout: +Suppose you have the following +ApplicationController+ layout: * +app/views/layouts/application.html.erb+ -- cgit v1.2.3 From 015114cbbbd29935a901640070957ddca5e00bde Mon Sep 17 00:00:00 2001 From: Josiah Ivey Date: Tue, 4 May 2010 09:52:31 -0500 Subject: image_tag should be audio_tag --- railties/guides/source/layouts_and_rendering.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 7be369453e..e1adbe5bdc 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -898,7 +898,7 @@ The +audio_tag+ helper builds an HTML 5 +<audio>+ tag to the specified fil You can supply a path to the image if you like: -<%= image_tag "music/first_song.mp3" %> +<%= audio_tag "music/first_song.mp3" %> You can also supply a hash of additional options, such as +:id+, +:class+ etc. -- cgit v1.2.3 From 44a98967676492995d19fd4d541dbc9d52bf6b53 Mon Sep 17 00:00:00 2001 From: Josiah Ivey Date: Tue, 4 May 2010 09:55:44 -0500 Subject: Change typo 'image' to 'audio file' --- railties/guides/source/layouts_and_rendering.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index e1adbe5bdc..a874fa0ca7 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -895,7 +895,7 @@ The +audio_tag+ helper builds an HTML 5 +<audio>+ tag to the specified fil <%= audio_tag "music.mp3" %> -You can supply a path to the image if you like: +You can supply a path to the audio file if you like: <%= audio_tag "music/first_song.mp3" %> -- cgit v1.2.3 From 6071b4720ce2a8ae0193da44536ab1b9f1b76eb0 Mon Sep 17 00:00:00 2001 From: Anil Wadghule Date: Thu, 6 May 2010 01:26:25 +0530 Subject: Updated guide to inform issues with unsupported Ruby versions. --- railties/guides/source/getting_started.textile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'railties/guides/source') diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index 7e3f2cc931..5da7ff7daa 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -16,6 +16,9 @@ h3. Guide Assumptions This guide is designed for beginners who want to get started with a Rails application from scratch. It does not assume that you have any prior experience with Rails. However, to get the most out of it, you need to have some prerequisites installed: * The "Ruby":http://www.ruby-lang.org/en/downloads language version 1.8.7 or higher + +TIP: Note that Ruby 1.8.7 p248 and p249 has marshaling bugs that crash Rails 3.0.0. Ruby 1.9.1 outright segfaults on Rails 3.0.0, so if you want to use Rails 3 with 1.9.x, jump on 1.9.2 trunk for smooth sailing. + * The "RubyGems":http://rubyforge.org/frs/?group_id=126 packaging system * A working installation of the "SQLite3 Database":http://www.sqlite.org -- cgit v1.2.3 From d3e405cdbc5fabe1325d5cbc9f52c8288f2d6024 Mon Sep 17 00:00:00 2001 From: Rohit Arondekar Date: Thu, 6 May 2010 20:33:24 -0700 Subject: Migrations, rewrote a sentence for clarity. --- railties/guides/source/migrations.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile index 6f88ed6b3f..a7316eab91 100644 --- a/railties/guides/source/migrations.textile +++ b/railties/guides/source/migrations.textile @@ -82,7 +82,7 @@ On databases that support transactions with statements that change the schema (s h4. What's in a Name -Migrations are stored in files in +db/migrate+, one for each migration class. The name of the file is of the form +YYYYMMDDHHMMSS_create_products.rb+, that is to say a UTC timestamp identifying the migration followed by an underscore followed by the name of the migration. The migration class' name must match (the camelcased version of) the latter part of the file name. For example +20080906120000_create_products.rb+ should define +CreateProducts+ and +20080906120001_add_details_to_products.rb+ should define +AddDetailsToProducts+. If you do feel the need to change the file name then you have to update the name of the class inside or Rails will complain about a missing class. +Migrations are stored in files in +db/migrate+, one for each migration class. The name of the file is of the form +YYYYMMDDHHMMSS_create_products.rb+, that is to say a UTC timestamp identifying the migration followed by an underscore followed by the name of the migration. The name of the migration class (CamelCased version) should match the latter part of the file name. For example +20080906120000_create_products.rb+ should define +CreateProducts+ and +20080906120001_add_details_to_products.rb+ should define +AddDetailsToProducts+. If you do feel the need to change the file name then you have to update the name of the class inside or Rails will complain about a missing class. Internally Rails only uses the migration's number (the timestamp) to identify them. Prior to Rails 2.1 the migration number started at 1 and was incremented each time a migration was generated. With multiple developers it was easy for these to clash requiring you to rollback migrations and renumber them. With Rails 2.1 this is largely avoided by using the creation time of the migration to identify them. You can revert to the old numbering scheme by setting +config.active_record.timestamped_migrations+ to +false+ in +config/environment.rb+. -- cgit v1.2.3 From 2cc1686bda5ff8f3e8976883ac2e8583713959a0 Mon Sep 17 00:00:00 2001 From: Rohit Arondekar Date: Fri, 7 May 2010 00:03:16 -0700 Subject: migration, correct file and created a code sample out of it. --- railties/guides/source/migrations.textile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile index a7316eab91..f05c0589b5 100644 --- a/railties/guides/source/migrations.textile +++ b/railties/guides/source/migrations.textile @@ -84,7 +84,11 @@ h4. What's in a Name Migrations are stored in files in +db/migrate+, one for each migration class. The name of the file is of the form +YYYYMMDDHHMMSS_create_products.rb+, that is to say a UTC timestamp identifying the migration followed by an underscore followed by the name of the migration. The name of the migration class (CamelCased version) should match the latter part of the file name. For example +20080906120000_create_products.rb+ should define +CreateProducts+ and +20080906120001_add_details_to_products.rb+ should define +AddDetailsToProducts+. If you do feel the need to change the file name then you have to update the name of the class inside or Rails will complain about a missing class. -Internally Rails only uses the migration's number (the timestamp) to identify them. Prior to Rails 2.1 the migration number started at 1 and was incremented each time a migration was generated. With multiple developers it was easy for these to clash requiring you to rollback migrations and renumber them. With Rails 2.1 this is largely avoided by using the creation time of the migration to identify them. You can revert to the old numbering scheme by setting +config.active_record.timestamped_migrations+ to +false+ in +config/environment.rb+. +Internally Rails only uses the migration's number (the timestamp) to identify them. Prior to Rails 2.1 the migration number started at 1 and was incremented each time a migration was generated. With multiple developers it was easy for these to clash requiring you to rollback migrations and renumber them. With Rails 2.1 this is largely avoided by using the creation time of the migration to identify them. You can revert to the old numbering scheme by adding the following line to +config/application.rb+. + + +config.active_record.timestamped_migrations = false + The combination of timestamps and recording which migrations have been run allows Rails to handle common situations that occur with multiple developers. -- cgit v1.2.3 From 7a5aa35ed09dbdf306adbe5786cca7019a10bf98 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 9 May 2010 02:28:13 +0300 Subject: AS guide: documents some Date calculations (calendar reform details pending) --- .../source/active_support_core_extensions.textile | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 32738fe070..a3cb864796 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -2648,11 +2648,58 @@ NOTE: Defined in +active_support/core_ext/proc.rb+. h3. Extensions to +Date+ -... +h4. Calculations + +All the following methods are defined in +active_support/core_ext/date/calculations.rb+. + +h5. +Date.current+ + +Active Support defines +Date.current+ to be today in the current time zone. That's like +Date.today+, except that it honors +Time.zone_default+. It also defines +Date.yesterday+ and +Date.tomorrow+, and the instance predicates +past?+, +today?+, and +future?+, all of them relative to +Date.current+. + +h5. Named dates + +h6. +last_year+, +next_year+ + +The methods +last_year+ and +next_year+ return a date with the same day/month in the last or next year: + + +d = Date.new(2010, 5, 8) # => Sat, 08 May 2010 +d.last_year # => Fri, 08 May 2009 +d.next_year # => Sun, 08 May 2011 + + +If date is the 29th of February of a leap year, you obtain the 28th: + + +d = Date.new(2000, 2, 29) # => Tue, 29 Feb 2000 +d.last_year # => Sun, 28 Feb 1999 +d.next_year # => Wed, 28 Feb 2001 + + +h6. +last_month+, +next_month+ + +The methods +last_month+ and +next_month+ return the a date with the same day in the last or next month: + + +d = Date.new(2010, 5, 8) # => Sat, 08 May 2010 +d.last_month # => Thu, 08 Apr 2010 +d.next_month # => Tue, 08 Jun 2010 + + +If such a day does not exist, the last day of the corresponding month is returned: + + +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).next_month # => Fri, 30 Jun 2000 +Date.new(2000, 1, 31).next_month # => Tue, 29 Feb 2000 + + +h4. Conversions h3. Extensions to +DateTime+ -... +NOTE TO SELF: Since +DateTime+ is a subclass of +Date+, you get inherited methods that return +DateTime+ objects. h3. Extensions to +Time+ -- cgit v1.2.3 From c31b386a8834130471a297faa720bfe4ff2e884e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 8 May 2010 21:41:41 -0300 Subject: Updates bundler information, now bundler has a homepage --- railties/guides/source/3_0_release_notes.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/3_0_release_notes.textile b/railties/guides/source/3_0_release_notes.textile index 622032e1ea..4b66baae1c 100644 --- a/railties/guides/source/3_0_release_notes.textile +++ b/railties/guides/source/3_0_release_notes.textile @@ -87,7 +87,7 @@ h4. Vendoring Gems Rails now uses a +Gemfile+ in the application root to determine the gems you require for your application to start. This +Gemfile+ is processed by the "Bundler":http://github.com/carlhuda/bundler, which then installs all your dependencies. It can even install all the dependencies locally to your application so that it doesn't depend on the system gems. -More information: - "bundler README on Github":http://github.com/carlhuda/bundler +More information: - "bundler homepage":http://gembundler.com h4. Living on the Edge -- cgit v1.2.3 From 345c38a5277400e96a0b6992192037f0eaa81718 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 9 May 2010 11:39:57 +0300 Subject: AS guide: adds a catchall note about date calculations around the calendar reform --- railties/guides/source/active_support_core_extensions.textile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'railties/guides/source') diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index a3cb864796..091a639270 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -2652,6 +2652,8 @@ h4. Calculations All the following methods are defined in +active_support/core_ext/date/calculations.rb+. +WARNING: The following calculation methods have edge cases in November 1582, since days 5..14 just do not exist. This guide does not document their behavior around those days for brevity, but it is enough to say that they do what you would expect. That is, +Date.new(1582, 10, 4).tomorrow+ returns +Date.new(1582, 10, 15)+ and so on. Please check +test/core_ext/date_ext_test.rb+ in the Active Support test suite for expected behavior. + h5. +Date.current+ Active Support defines +Date.current+ to be today in the current time zone. That's like +Date.today+, except that it honors +Time.zone_default+. It also defines +Date.yesterday+ and +Date.tomorrow+, and the instance predicates +past?+, +today?+, and +future?+, all of them relative to +Date.current+. -- cgit v1.2.3 From 08d991ad409295a2d91b10bca4c7080fdbe7b5b9 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 9 May 2010 11:44:22 +0300 Subject: AS guide: you know, the 10th is not November --- railties/guides/source/active_support_core_extensions.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 091a639270..d321e3db72 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -2652,7 +2652,7 @@ h4. Calculations All the following methods are defined in +active_support/core_ext/date/calculations.rb+. -WARNING: The following calculation methods have edge cases in November 1582, since days 5..14 just do not exist. This guide does not document their behavior around those days for brevity, but it is enough to say that they do what you would expect. That is, +Date.new(1582, 10, 4).tomorrow+ returns +Date.new(1582, 10, 15)+ and so on. Please check +test/core_ext/date_ext_test.rb+ in the Active Support test suite for expected behavior. +INFO: The following calculation methods have edge cases in October 1582, since days 5..14 just do not exist. This guide does not document their behavior around those days for brevity, but it is enough to say that they do what you would expect. That is, +Date.new(1582, 10, 4).tomorrow+ returns +Date.new(1582, 10, 15)+ and so on. Please check +test/core_ext/date_ext_test.rb+ in the Active Support test suite for expected behavior. h5. +Date.current+ -- cgit v1.2.3 From 1ff3d951e620ddeeb97e87e2024391470e886467 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 9 May 2010 12:45:21 +0300 Subject: AS guide: more date calculation utilities --- .../source/active_support_core_extensions.textile | 60 +++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index d321e3db72..b7b5f47eef 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -2680,7 +2680,7 @@ d.next_year # => Wed, 28 Feb 2001 h6. +last_month+, +next_month+ -The methods +last_month+ and +next_month+ return the a date with the same day in the last or next month: +The methods +last_month+ and +next_month+ return the date with the same day in the last or next month: d = Date.new(2010, 5, 8) # => Sat, 08 May 2010 @@ -2697,6 +2697,64 @@ Date.new(2000, 5, 31).next_month # => Fri, 30 Jun 2000 Date.new(2000, 1, 31).next_month # => Tue, 29 Feb 2000 +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: + + +d = Date.new(2010, 5, 8) # => Sat, 08 May 2010 +d.beginning_of_week # => Mon, 03 May 2010 +d.end_of_week # => Sun, 09 May 2010 + + ++beginning_of_week+ is aliased to +monday+ and +at_beginning_of_week+. +end_of_week+ is aliased to +sunday+ and +at_end_of_week+. + +h6. +next_week+ + ++next_week+ receives a symbol with a day name in English (in lowercase, default is +:monday+) and it returns the date corresponding to that day in the next week: + + +d = Date.new(2010, 5, 9) # => Sun, 09 May 2010 +d.next_week # => Mon, 10 May 2010 +d.next_week(:saturday) # => Sat, 15 May 2010 + + +h6. +beginning_of_month+, +end_of_month+ + +The methods +beginning_of_month+ and +end_of_month+ return the dates for the beginning and end of the month: + + +d = Date.new(2010, 5, 9) # => Sun, 09 May 2010 +d.beginning_of_month # => Sat, 01 May 2010 +d.end_of_month # => Mon, 31 May 2010 + + ++beginning_of_month+ is aliased to +at_beginning_of_month+, and +end_of_month+ is aliased to +at_end_of_month+. + +h6. +beginning_of_quarter+, +end_of_quarter+ + +The methods +beginning_of_quarter+ and +end_of_quarter+ return the dates for the beginning and end of the quarter of the receiver's calendar year: + + +d = Date.new(2010, 5, 9) # => Sun, 09 May 2010 +d.beginning_of_quarter # => Thu, 01 Apr 2010 +d.end_of_quarter # => Wed, 30 Jun 2010 + + ++beginning_of_quarter+ is aliased to +at_beginning_of_quarter+, and +end_of_quarter+ is aliased to +at_end_of_quarter+. + +h6. +beginning_of_year+, +end_of_year+ + +The methods +beginning_of_year+ and +end_of_year+ return the dates for the beginning and end of the year: + + +d = Date.new(2010, 5, 9) # => Sun, 09 May 2010 +d.beginning_of_year # => Fri, 01 Jan 2010 +d.end_of_year # => Fri, 31 Dec 2010 + + ++beginning_of_year+ is aliased to +at_beginning_of_year+, and +end_of_year+ is aliased to +at_end_of_year+. + h4. Conversions h3. Extensions to +DateTime+ -- cgit v1.2.3