aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/belongs_to_association.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-02-13 06:32:50 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-02-13 06:32:50 +0000
commitdfa786631bb8476c8cae555ad8de5e83811dfe9d (patch)
treef1e9a04a9966a91ac4a283e9453134cbb95755de /activerecord/lib/active_record/associations/belongs_to_association.rb
parent08a4c9979da44654f057494dc76498ed6a8506bc (diff)
downloadrails-dfa786631bb8476c8cae555ad8de5e83811dfe9d.tar.gz
rails-dfa786631bb8476c8cae555ad8de5e83811dfe9d.tar.bz2
rails-dfa786631bb8476c8cae555ad8de5e83811dfe9d.zip
Introduce the :readonly option to all associations. Records from the association cannot be saved. Closes #11084.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8864 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations/belongs_to_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/belongs_to_association.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb
index f5557618c4..9ff3f13592 100644
--- a/activerecord/lib/active_record/associations/belongs_to_association.rb
+++ b/activerecord/lib/active_record/associations/belongs_to_association.rb
@@ -44,7 +44,8 @@ module ActiveRecord
@reflection.klass.find(
@owner[@reflection.primary_key_name],
:conditions => conditions,
- :include => @reflection.options[:include]
+ :include => @reflection.options[:include],
+ :readonly => @reflection.options[:readonly]
)
end