aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides/html/active_record_querying.html
diff options
context:
space:
mode:
Diffstat (limited to 'railties/doc/guides/html/active_record_querying.html')
-rw-r--r--railties/doc/guides/html/active_record_querying.html430
1 files changed, 131 insertions, 299 deletions
diff --git a/railties/doc/guides/html/active_record_querying.html b/railties/doc/guides/html/active_record_querying.html
index 043e5120d1..cc2a6b7e4a 100644
--- a/railties/doc/guides/html/active_record_querying.html
+++ b/railties/doc/guides/html/active_record_querying.html
@@ -1,305 +1,137 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Active Record Query Interface</title>
- <!--[if lt IE 8]>
- <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
- <![endif]-->
- <link href="stylesheets/base.css" media="screen" rel="Stylesheet" type="text/css" />
- <link href="stylesheets/forms.css" media="screen" rel="Stylesheet" type="text/css" />
- <link href="stylesheets/more.css" media="screen" rel="Stylesheet" type="text/css" />
- <style type="text/css">
- div#container {
- max-width: 900px;
- padding-bottom: 3em;
-}
-
-div#content {
- margin-left: 200px;
-}
-
-div#container.notoc {
- max-width: 600px;
-}
-
-.notoc div#content {
- margin-left: 0;
-}
-
-pre {
- line-height: 1.4em;
-}
-
-#content p tt {
- background: #eeeeee;
- border: solid 1px #cccccc;
- padding: 3px;
-}
-
-dt {
- font-weight: bold;
-}
-
-#content dt tt {
- font-size: 10pt;
-}
-
-dd {
- margin-left: 3em;
-}
-
-#content dt tt, #content pre tt {
- background: none;
- padding: 0;
- border: 0;
-}
-
-#content .olist ol {
- margin-left: 2em;
-}
-
-#header {
- position: relative;
- max-width: 840px;
- margin-left: auto;
- margin-right: auto;
-}
-
-#header.notoc {
- max-width: 580px;
-}
-
-#logo {
- position: absolute;
- left: 10px;
- top: 10px;
- width: 110px;
- height: 140px;
-}
-
-div#header h1#site_title {
- background: url('images/ruby_on_rails_by_mike_rundle2.gif') top left no-repeat;
- position: absolute;
- width: 392px;
- height: 55px;
- left: 145px;
- top: 20px;
- margin: 0;
- padding: 0;
-}
-
-#site_title span {
- display: none;
-}
-
-#site_title_tagline {
- display: none;
-}
-
-ul#navMain {
- position: absolute;
- margin: 0;
- padding: 0;
- top: 97px;
- left: 145px;
-}
-
-.left-floaty, .right-floaty {
- padding: 15px;
-}
-
-.admonitionblock,
-.tableblock {
- margin-left: 1em;
- margin-right: 1em;
- margin-top: 0.25em;
- margin-bottom: 1em;
-}
-
-.admonitionblock .icon {
- padding-right: 8px;
-}
-
-.admonitionblock .content {
- border: solid 1px #ffda78;
- background: #fffebd;
- padding: 10px;
- padding-top: 8px;
- padding-bottom: 8px;
-}
-
-.admonitionblock .title {
- font-size: 140%;
- margin-bottom: 0.5em;
-}
-
-.tableblock table {
- border: solid 1px #aaaaff;
- background: #f0f0ff;
-}
-
-.tableblock th {
- background: #e0e0e0;
-}
-
-.tableblock th,
-.tableblock td {
- padding: 3px;
- padding-left: 5px;
- padding-right: 5px;
-}
-
-.sidebarblock {
- margin-top: 0.25em;
- margin: 1em;
- border: solid 1px #ccccbb;
- padding: 8px;
- background: #ffffe0;
-}
-
-.sidebarblock .sidebar-title {
- font-size: 140%;
- font-weight: 600;
- margin-bottom: 0.3em;
-}
-
-.sidebarblock .sidebar-content > .para:last-child > p {
- margin-bottom: 0;
-}
-
-.sidebarblock .sidebar-title a {
- text-decoration: none;
-}
-
-.sidebarblock .sidebar-title a:hover {
- text-decoration: underline;
-}
-
- </style>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Active Record Query Interface</title>
+ <!--[if lt IE 8]>
+ <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
+ <![endif]-->
+ <link href="stylesheets/base.css" media="screen" rel="Stylesheet" type="text/css" />
+ <link href="stylesheets/forms.css" media="screen" rel="Stylesheet" type="text/css" />
+ <link href="stylesheets/more.css" media="screen" rel="Stylesheet" type="text/css" />
</head>
<body>
- <div id="header" >
- <div id="logo">
- <a href="index.html" title="Ruby on Rails"><img src="images/rails_logo_remix.gif" alt="Rails" height="140" width="110" /></a>
- </div>
-
- <h1 id="site_title"><span>Ruby on Rails</span></h1>
- <h2 id="site_title_tagline">Sustainable productivity for web-application development</h2>
-
- <ul id="navMain">
- <li class="first-child"><a href="http://www.rubyonrails.org/" title="Ruby on Rails" class="ruby_on_rails">Ruby on Rails</a></li>
- <li><a class="manuals" href="index.html" title="Manuals Index">Guides Index</a></li>
- </ul>
- </div>
-
- <div id="container">
-
- <div id="sidebar">
- <h2>Chapters</h2>
- <ol>
- <li>
- <a href="#_ids_first_last_and_all">IDs, First, Last and All</a>
- </li>
- <li>
- <a href="#_conditions">Conditions</a>
- <ul>
-
- <li><a href="#_pure_string_conditions">Pure String Conditions</a></li>
-
- <li><a href="#_array_conditions">Array Conditions</a></li>
-
- <li><a href="#_placeholder_conditions">Placeholder Conditions</a></li>
-
- <li><a href="#_hash_conditions">Hash Conditions</a></li>
-
- </ul>
- </li>
- <li>
- <a href="#_ordering">Ordering</a>
- </li>
- <li>
- <a href="#_selecting_certain_fields">Selecting Certain Fields</a>
- </li>
- <li>
- <a href="#_limit_amp_offset">Limit &amp; Offset</a>
- </li>
- <li>
- <a href="#_group">Group</a>
- </li>
- <li>
- <a href="#_having">Having</a>
- </li>
- <li>
- <a href="#_read_only">Read Only</a>
- </li>
- <li>
- <a href="#_lock">Lock</a>
- </li>
- <li>
- <a href="#_making_it_all_work_together">Making It All Work Together</a>
- </li>
- <li>
- <a href="#_eager_loading">Eager Loading</a>
- </li>
- <li>
- <a href="#_dynamic_finders">Dynamic finders</a>
- </li>
- <li>
- <a href="#_finding_by_sql">Finding By SQL</a>
- </li>
- <li>
- <a href="#_tt_select_all_tt"><tt>select_all</tt></a>
- </li>
- <li>
- <a href="#_working_with_associations">Working with Associations</a>
- </li>
- <li>
- <a href="#_named_scopes">Named Scopes</a>
- <ul>
-
- <li><a href="#_simple_named_scopes">Simple Named Scopes</a></li>
-
- <li><a href="#_combining_named_scopes">Combining Named Scopes</a></li>
-
- <li><a href="#_runtime_evaluation_of_named_scope_conditions">Runtime Evaluation of Named Scope Conditions</a></li>
-
- <li><a href="#_named_scopes_with_multiple_models">Named Scopes with Multiple Models</a></li>
-
- <li><a href="#_arguments_to_named_scopes">Arguments to Named Scopes</a></li>
-
- <li><a href="#_anonymous_scopes">Anonymous Scopes</a></li>
-
- </ul>
- </li>
- <li>
- <a href="#_existence_of_objects">Existence of Objects</a>
- </li>
- <li>
- <a href="#_calculations">Calculations</a>
- <ul>
-
- <li><a href="#_count">Count</a></li>
-
- <li><a href="#_average">Average</a></li>
-
- <li><a href="#_minimum">Minimum</a></li>
-
- <li><a href="#_maximum">Maximum</a></li>
-
- <li><a href="#_sum">Sum</a></li>
-
- </ul>
- </li>
- <li>
- <a href="#_changelog">Changelog</a>
- </li>
- </ol>
- </div>
-
- <div id="content">
- <h1>Active Record Query Interface</h1>
- <div id="preamble">
+ <div id="header" >
+ <div id="logo">
+ <a href="index.html" title="Ruby on Rails"><img src="images/rails_logo_remix.gif" alt="Rails" height="140" width="110" /></a>
+ </div>
+
+ <h1 id="site_title"><span>Ruby on Rails</span></h1>
+ <h2 id="site_title_tagline">Sustainable productivity for web-application development</h2>
+
+ <ul id="navMain">
+ <li class="first-child"><a href="http://www.rubyonrails.org/" title="Ruby on Rails" class="ruby_on_rails">Ruby on Rails</a></li>
+ <li><a class="manuals" href="index.html" title="Manuals Index">Guides Index</a></li>
+ </ul>
+ </div>
+
+ <div id="container">
+
+ <div id="sidebar">
+ <h2>Chapters</h2>
+ <ol>
+ <li>
+ <a href="#_ids_first_last_and_all">IDs, First, Last and All</a>
+ </li>
+ <li>
+ <a href="#_conditions">Conditions</a>
+ <ul>
+
+ <li><a href="#_pure_string_conditions">Pure String Conditions</a></li>
+
+ <li><a href="#_array_conditions">Array Conditions</a></li>
+
+ <li><a href="#_placeholder_conditions">Placeholder Conditions</a></li>
+
+ <li><a href="#_hash_conditions">Hash Conditions</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="#_ordering">Ordering</a>
+ </li>
+ <li>
+ <a href="#_selecting_certain_fields">Selecting Certain Fields</a>
+ </li>
+ <li>
+ <a href="#_limit_amp_offset">Limit &amp; Offset</a>
+ </li>
+ <li>
+ <a href="#_group">Group</a>
+ </li>
+ <li>
+ <a href="#_having">Having</a>
+ </li>
+ <li>
+ <a href="#_read_only">Read Only</a>
+ </li>
+ <li>
+ <a href="#_lock">Lock</a>
+ </li>
+ <li>
+ <a href="#_making_it_all_work_together">Making It All Work Together</a>
+ </li>
+ <li>
+ <a href="#_eager_loading">Eager Loading</a>
+ </li>
+ <li>
+ <a href="#_dynamic_finders">Dynamic finders</a>
+ </li>
+ <li>
+ <a href="#_finding_by_sql">Finding By SQL</a>
+ </li>
+ <li>
+ <a href="#_tt_select_all_tt"><tt>select_all</tt></a>
+ </li>
+ <li>
+ <a href="#_working_with_associations">Working with Associations</a>
+ </li>
+ <li>
+ <a href="#_named_scopes">Named Scopes</a>
+ <ul>
+
+ <li><a href="#_simple_named_scopes">Simple Named Scopes</a></li>
+
+ <li><a href="#_combining_named_scopes">Combining Named Scopes</a></li>
+
+ <li><a href="#_runtime_evaluation_of_named_scope_conditions">Runtime Evaluation of Named Scope Conditions</a></li>
+
+ <li><a href="#_named_scopes_with_multiple_models">Named Scopes with Multiple Models</a></li>
+
+ <li><a href="#_arguments_to_named_scopes">Arguments to Named Scopes</a></li>
+
+ <li><a href="#_anonymous_scopes">Anonymous Scopes</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="#_existence_of_objects">Existence of Objects</a>
+ </li>
+ <li>
+ <a href="#_calculations">Calculations</a>
+ <ul>
+
+ <li><a href="#_count">Count</a></li>
+
+ <li><a href="#_average">Average</a></li>
+
+ <li><a href="#_minimum">Minimum</a></li>
+
+ <li><a href="#_maximum">Maximum</a></li>
+
+ <li><a href="#_sum">Sum</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="#_changelog">Changelog</a>
+ </li>
+ </ol>
+ </div>
+
+ <div id="content">
+ <h1>Active Record Query Interface</h1>
+ <div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>This guide covers different ways to retrieve data from the database using Active Record. By referring to this guide, you will be able to:</p></div>
<div class="ulist"><ul>
@@ -1094,7 +926,7 @@ December 29 2008: Initial version by Ryan Bigg
</ul></div>
</div>
- </div>
- </div>
+ </div>
+ </div>
</body>
</html>