diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-17 10:49:47 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-17 10:49:47 -0800 |
commit | c71df74fb1084c9204233ecb37fe54be243cfdc2 (patch) | |
tree | a1fbc29109c5228526b440218bcb785c2e72d423 /guides | |
parent | e7f5317ff9696e7e38c56d403ec822ee94aa8e24 (diff) | |
parent | 486db21f919c39cef76b487be45290b7561307e8 (diff) | |
download | rails-c71df74fb1084c9204233ecb37fe54be243cfdc2.tar.gz rails-c71df74fb1084c9204233ecb37fe54be243cfdc2.tar.bz2 rails-c71df74fb1084c9204233ecb37fe54be243cfdc2.zip |
Merge branch 'master' into adequaterecord
* master:
Fix eager load of Serializers on Active Model
Consistence in the block style
Remove warnings on Ruby 2.1
Only some dynamic finders are deprecated.
clean up security guide: his => their [ci skip]
Remove warning
Extract a method to simplify setup code
Use minitest's skip rather than conditionals + early returns
Move AR test classes inside the test case
Do not set up a variable used only in two tests
No need for instance vars on single tests
Cleanup duplicated setup of callbacks in transactions tests
No need to use #send with public methods
Update deprecation warning to give more information about caller
Update changelog
Avoid scanning multiple render calls as a single match.
Improve ERB dependency detection.
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_record_querying.md | 10 | ||||
-rw-r--r-- | guides/source/security.md | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 4725e2c8a2..3783be50c0 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -1338,11 +1338,6 @@ Client.unscoped { Dynamic Finders --------------- -NOTE: Dynamic finders have been deprecated in Rails 4.0 and will be -removed in Rails 4.1. The best practice is to use Active Record scopes -instead. You can find the deprecation gem at -https://github.com/rails/activerecord-deprecated_finders - For every field (also known as an attribute) you define in your table, Active Record provides a finder method. If you have a field called `first_name` on your `Client` model for example, you get `find_by_first_name` for free from Active Record. If you have a `locked` field on the `Client` model, you also get `find_by_locked` and methods. You can specify an exclamation point (`!`) on the end of the dynamic finders to get them to raise an `ActiveRecord::RecordNotFound` error if they do not return any records, like `Client.find_by_name!("Ryan")` @@ -1352,6 +1347,11 @@ If you want to find both by name and locked, you can chain these finders togethe Find or Build a New Object -------------------------- +NOTE: Some dynamic finders have been deprecated in Rails 4.0 and will be +removed in Rails 4.1. The best practice is to use Active Record scopes +instead. You can find the deprecation gem at +https://github.com/rails/activerecord-deprecated_finders + It's common that you need to find a record or create it if it doesn't exist. You can do that with the `find_or_create_by` and `find_or_create_by!` methods. ### `find_or_create_by` diff --git a/guides/source/security.md b/guides/source/security.md index c367604d6f..cffe7c85f1 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -81,7 +81,7 @@ Here are some general guidelines on sessions. * _Do not store large objects in a session_. Instead you should store them in the database and save their id in the session. This will eliminate synchronization headaches and it won't fill up your session storage space (depending on what session storage you chose, see below). This will also be a good idea, if you modify the structure of an object and old versions of it are still in some user's cookies. With server-side session storages you can clear out the sessions, but with client-side storages, this is hard to mitigate. -* _Critical data should not be stored in session_. If the user clears his cookies or closes the browser, they will be lost. And with a client-side session storage, the user can read the data. +* _Critical data should not be stored in session_. If the user clears their cookies or closes the browser, they will be lost. And with a client-side session storage, the user can read the data. ### Session Storage |