Commit Graph

78 Commits

Author SHA1 Message Date
Markov Alexey
01ea8c22dd Update association_basics.md 2015-04-19 08:33:19 +03:00
Carlos Antonio da Silva
f54e89bf59 Improve note about unique index and foreign key on has_one association
Related to f1af967e0055a33c45071848a049ff342e9c291e. [ci skip]
2015-04-13 08:13:16 -03:00
Zachary Scott
f1af967e00 Add note wrt foreign key constraint to ensure data integrity
Thanks for patch @sgrif :trollface:

Closes #18216
2015-04-12 20:20:48 -07:00
Zachary Scott
558597c0f8 Merge pull request #19564 from jonatack/counter_cache_docs
[skip ci] Fix counter_cache in the Rails Guides
2015-04-12 16:29:09 -07:00
Robin Dupret
5493e9c7f8 Fix a few typos and wrap some lines [ci skip] 2015-04-12 15:34:28 +02:00
Jon Atack
478a755387 [skip ci] primay_key -> primary_key 2015-04-11 15:38:07 +05:30
Zachary Scott
d2998764c5 Copy edits for primary_key documentation in association guide. [ci skip] 2015-04-10 17:27:40 -07:00
Zachary Scott
47dc07313b Merge branch 'belongs_to_primary_key_doc' of https://github.com/girishso/rails into girishso-belongs_to_primary_key_doc 2015-04-10 17:20:40 -07:00
Jon Atack
676514c082 [skip ci] Fix counter_cache in the Rails Guides
In the AR Associations Guide, this PR fixes:

- The counter_cache declaration is now shown only in the `belongs_to`
association.

- The docs stated that the counter_cache declaration needs to be on the
`has_many` side; now corrected to the `belongs_to` side.

- Split the custom column explanation out to a separate paragraph.

- Simplify the NOTE because it is true both with and without a custom
column name.
2015-03-28 11:23:11 +05:30
Akshay Vishnoi
e3c70df197 [ci skip] use true as value rather than symbol 2015-03-19 10:50:50 +05:30
Akshay Vishnoi
64e27f9230 [ci skip] use false as value rather than symbol 2015-03-19 07:25:59 +05:30
Steve Lounsbury
ec85f9da29 Composite index is [:imageable_type, :imageable_id] [ci skip] 2015-03-01 21:38:41 -05:00
Steve Lounsbury
683ad0b471 Indexing a polymorphic assoc adds index on type and id [ci skip] 2015-03-01 14:06:38 -05:00
Robin Dupret
803ef74f9b Tiny documentation edits [ci skip] 2015-02-24 22:22:15 +01:00
Josef Šimánek
6576f7354e Require belongs_to by default.
Deprecate `required` option in favor of `optional` for belongs_to.
2015-02-21 23:03:10 +01:00
Konstantinos Rousis
6ef2ce0aed Replace deprecated readonly option with scope blocks in docs and guide 2015-02-18 09:44:43 +01:00
Vijay Dev
95546d4935 Merge branch 'master' of github.com:rails/docrails 2015-02-14 15:35:47 +00:00
Juanito Fatas
773dd2598d [ci skip] Add some more code highlights. 2015-02-10 22:42:41 +08:00
Andrey Nering
017de712ee Add Single Table Inheritance to guides [ci skip] 2015-01-31 17:07:14 -02:00
Juanito Fatas
fa3108a9ef [ci skip] Add a missing space in t.belongs_to argument. 2015-01-29 15:30:47 +08:00
Vipul A M
5cfaf5a46e - Changed IN to ON in markdown renderer condition
- Changed `IN` to `ON` in all note sentences in guides.
2015-01-14 11:52:13 +05:30
Robin Dupret
73fe108d70 Minor documentation edits [ci skip] 2014-12-28 22:55:09 +01:00
Xavier Noria
7702974281 warn about reading guides in GitHub
References #18148.
2014-12-23 23:32:50 +01:00
Steve Lounsbury
d60556e967 You need to specify the counter_cache option on the has_many side of the association when using a custom counter cache column. This is documented on the has_many association here: http://apidock.com/rails/ActiveRecord/Associations/ClassMethods/has_many [ci skip] 2014-12-16 01:58:19 +00:00
Zachary Scott
6b96a1eae1 Add null option to timestamps as migration generator does [ci skip] 2014-12-14 20:42:38 -05:00
Aaron Huang
263e9e4681 [ci skip] Remove outdate note of :dependent 2014-11-28 01:34:33 +08:00
Girish S
849715ad67 added primary_key option documentation for belongs_to association
fixes issue #16698
2014-09-23 15:21:17 +05:30
Juanito Fatas
29366cdad7 [ci skip] Fix some typos, normalize sentence.
Follow up of #16722.

https://github.com/rails/rails/pull/16722

also normalize all instance gained methods’ sentence.
2014-09-08 03:29:48 +08:00
Rafael Mendonça França
17a39c841d Merge pull request #16722 from yui-knk/fix/guides_association_basics2
[ci skip] Fix typo of `collection_singular_ids=` method.
2014-08-27 10:49:48 -03:00
yui-knk
2d2cd7e648 [ci skip] Fix typo of collection= method. 2014-08-27 22:37:56 +09:00
yui-knk
277355ade0 [ci skip] Fix typo of collection_singular_ids= method. 2014-08-27 22:34:52 +09:00
Matt Warren
0f9118ab6f adding indexes on tables in migration scripts
missed one migration script in last commit

remove some empty lines

using the belongs_to index option to be more concise
2014-07-24 19:18:00 -02:30
Nishant Modak
da5ac71885 correct markdown usage [ci skip] 2014-07-09 01:32:44 +05:30
John Kelly Ferguson
d02c810e29 Rename Posts to Articles in Guides, continuation of 2d446e77 / #13774 [ci skip] 2014-05-21 23:01:45 -04:00
Juanito Fatas
982a19edc9 [ci skip] Use plain underscore instead of "\_". 2014-04-13 23:56:59 +08:00
Rohit Paul Kuruvilla
464d47eaaf Updated association_basics.md [ci skip]
Updated association_basics.md to include how to write migrations for self joins

Update association_basics.md

Corrected the update

Update association_basics.md

Typo fix

Changed :employee to :manager
2014-01-31 11:31:19 +05:30
Kuldeep Aggarwal
647cff3a13 updating options documentation for associations
removed unnecessary test case and improved test case for belongs_to having invalid  options
2013-11-29 18:49:56 +05:30
Juanito Fatas
01d75f038e [ci skip] Fix number of methods added by association.
Also clean up some trailing spaces on line 1143-1146.
2013-10-17 02:45:04 +08:00
Ofer Nave
803ecc7334 added "id: false" to HABTM join table example
Based on the instructions further down in section 3.3.2.
2013-09-24 20:34:50 -04:00
Rafael Mendonça França
83b92c67cc Fix the model name in the association basics guides
[ci skip]
2013-09-23 15:27:43 -03:00
Xavier Noria
b77f25cb84 cleans the guides sources from fancy non-ASCII stuff 2013-08-23 17:59:11 +02:00
Ilya Vorontsov
ac02c190a5 Added comment to a guide about necessity of :dependent option for associations with NOT NULL constraint 2013-08-12 17:50:35 +04:00
Gaurish Sharma
e54c225b16 [Fixes #11734]Correct Association Basics Guide on has_and_belongs_to_many[ci skip]
Done the following changes:
 1. Replace uniq call in example with autosave as uniq is not supported
 on has_and_belongs_to_many
 2. Add :readonly option to list of supported call as per
 [EdgeApi](http://edgeapi.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_and_belongs_to_many)
2013-08-03 20:08:20 +05:30
Daniel Dawson
8cece08ce3 Fix a grammatical error/typo in Active Record Associations guide. 2013-07-11 12:09:59 +01:00
Cristian Planas
93fd780a88 Using preferred find_by syntax in guides 2013-07-01 01:38:46 +02:00
Mikhail Dieterle
1010f9382b fix quotes and ruby old hashes 2013-06-15 18:39:17 +03:00
Mikhail Dieterle
d4794fd9d2 Use markdown quotes instead <tt> tag 2013-06-15 18:09:07 +03:00
Matthew Hensrud
f1d453b4fd Added bang method versions to association basics guide 2013-06-07 17:37:02 -04:00
Sunny Ripert
666d028bb8 End-of-line whitespace hunt 2013-05-28 14:38:01 +02:00
Neeraj Singh
54ce21ee8d Added an example for primary_key option 2013-05-22 10:37:37 -04:00