diff options
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_model_basics.md | 4 | ||||
-rw-r--r-- | guides/source/active_record_basics.md | 2 | ||||
-rw-r--r-- | guides/source/caching_with_rails.md | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/guides/source/active_model_basics.md b/guides/source/active_model_basics.md index 8dee1cc5ec..88de4e2d9f 100644 --- a/guides/source/active_model_basics.md +++ b/guides/source/active_model_basics.md @@ -396,7 +396,7 @@ class Person end ``` -With the `to_xml` you have a XML representing the model. +With the `to_xml` you have an XML representing the model. ```ruby person = Person.new @@ -405,7 +405,7 @@ person.name = "Bob" person.to_xml # => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<person>\n <name>Bob</name>\n</person>\n" ``` -From a XML string you define the attributes of the model. +From an XML string you define the attributes of the model. You need to have the `attributes=` method defined on your class: ```ruby diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md index 9d2ba328ea..76516a03df 100644 --- a/guides/source/active_record_basics.md +++ b/guides/source/active_record_basics.md @@ -62,7 +62,7 @@ Convention over Configuration in Active Record When writing applications using other programming languages or frameworks, it may be necessary to write a lot of configuration code. This is particularly true for ORM frameworks in general. However, if you follow the conventions adopted by -Rails, you'll need to write very little configuration (in some case no +Rails, you'll need to write very little configuration (in some cases no configuration at all) when creating Active Record models. The idea is that if you configure your applications in the very same way most of the time then this should be the default way. Thus, explicit configuration would be needed diff --git a/guides/source/caching_with_rails.md b/guides/source/caching_with_rails.md index 61b991df61..d5477eb72d 100644 --- a/guides/source/caching_with_rails.md +++ b/guides/source/caching_with_rails.md @@ -184,6 +184,10 @@ class ProductsController < ApplicationController end ``` +The second time the same query is run against the database, it's not actually going to hit the database. The first time the result is returned from the query it is stored in the query cache (in memory) and the second time it's pulled from memory. + +However, it's important to note that query caches are created at the start of an action and destroyed at the end of that action and thus persist only for the duration of the action. If you'd like to store query results in a more persistent fashion, you can in Rails by using low level caching. + Cache Stores ------------ |