From 411e4597d552aa091cfe3dc76a83bdaffe02da1a Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 8 Mar 2016 11:46:11 +0900 Subject: Preserve readonly flag only for readonly association Fixes #24093 --- activerecord/test/models/post.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index bf3079a1df..2129a56075 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -24,6 +24,7 @@ class Post < ActiveRecord::Base scope :limit_by, lambda {|l| limit(l) } belongs_to :author + belongs_to :readonly_author, -> { readonly }, class_name: 'Author', foreign_key: :author_id belongs_to :author_with_posts, -> { includes(:posts) }, :class_name => "Author", :foreign_key => :author_id belongs_to :author_with_address, -> { includes(:author_address) }, :class_name => "Author", :foreign_key => :author_id -- cgit v1.2.3