diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-18 23:17:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-18 23:17:23 -0300 |
commit | 28aaf77bb07af5e0108ff986e192e71da6d25078 (patch) | |
tree | 264a7b3676e48033f9f86b07de49f914800a8877 /activerecord/test/models | |
parent | 085166d59a039bce0e45979a2dec25160bc80f14 (diff) | |
parent | 411e4597d552aa091cfe3dc76a83bdaffe02da1a (diff) | |
download | rails-28aaf77bb07af5e0108ff986e192e71da6d25078.tar.gz rails-28aaf77bb07af5e0108ff986e192e71da6d25078.tar.bz2 rails-28aaf77bb07af5e0108ff986e192e71da6d25078.zip |
Merge pull request #24099 from k0kubun/preserve-readonly
Preserve readonly flag only for readonly association
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/post.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index 42eff9cff9..66a99cbcda 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 |