Clearer has_one/belongs_to model names (account has_one :user). Closes #5632.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4577 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
c4782f7393
commit
69d8ca4c52
@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Clearer has_one/belongs_to model names (account has_one :user). #5632 [matt@mattmargolis.net]
|
||||
|
||||
* Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. #5635 [schoenm@earthlink.net]
|
||||
|
||||
* Fixed a few Oracle issues: Allows Oracle's odd date handling to still work consistently within #to_xml, Passes test that hardcode insert statement by dropping the :id column, Updated RUNNING_UNIT_TESTS with Oracle instructions, Corrects method signature for #exec #5294 [schoenm@earthlink.net]
|
||||
|
@ -118,25 +118,27 @@ def clear_association_cache #:nodoc:
|
||||
# Both express a 1-1 relationship, the difference is mostly where to place the foreign key, which goes on the table for the class
|
||||
# saying belongs_to. Example:
|
||||
#
|
||||
# class Post < ActiveRecord::Base
|
||||
# has_one :author
|
||||
# class User < ActiveRecord::Base
|
||||
# # I reference an account.
|
||||
# belongs_to :account
|
||||
# end
|
||||
#
|
||||
# class Author < ActiveRecord::Base
|
||||
# belongs_to :post
|
||||
# class Account < ActiveRecord::Base
|
||||
# # One user references me.
|
||||
# has_one :user
|
||||
# end
|
||||
#
|
||||
# The tables for these classes could look something like:
|
||||
#
|
||||
# CREATE TABLE posts (
|
||||
# CREATE TABLE users (
|
||||
# id int(11) NOT NULL auto_increment,
|
||||
# title varchar default NULL,
|
||||
# account_id int(11) default NULL,
|
||||
# name varchar default NULL,
|
||||
# PRIMARY KEY (id)
|
||||
# )
|
||||
#
|
||||
# CREATE TABLE authors (
|
||||
# CREATE TABLE accounts (
|
||||
# id int(11) NOT NULL auto_increment,
|
||||
# post_id int(11) default NULL,
|
||||
# name varchar default NULL,
|
||||
# PRIMARY KEY (id)
|
||||
# )
|
||||
|
Loading…
Reference in New Issue
Block a user