aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/person.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-23 06:58:10 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-23 06:58:10 -0700
commit030d30d64cd8d8e376f9db25a3fe3e11358731cf (patch)
tree6584d98b81430685a2cd57b507ea507dfa7ab884 /activerecord/test/models/person.rb
parent9e5b8e3831552a103b2dcf8de75fb6a2337d42ba (diff)
parentef99c1147592e91bb256952986470592ea0e5f6c (diff)
downloadrails-030d30d64cd8d8e376f9db25a3fe3e11358731cf.tar.gz
rails-030d30d64cd8d8e376f9db25a3fe3e11358731cf.tar.bz2
rails-030d30d64cd8d8e376f9db25a3fe3e11358731cf.zip
Merge pull request #10713 from senny/10693_fix_primary_key_option_on_has_many
Fix the `:primary_key` option for `has_many` associations.
Diffstat (limited to 'activerecord/test/models/person.rb')
-rw-r--r--activerecord/test/models/person.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb
index 2985160d28..1a282dbce4 100644
--- a/activerecord/test/models/person.rb
+++ b/activerecord/test/models/person.rb
@@ -32,6 +32,7 @@ class Person < ActiveRecord::Base
has_many :agents_posts, :through => :agents, :source => :posts
has_many :agents_posts_authors, :through => :agents_posts, :source => :author
+ has_many :essays, primary_key: "first_name", foreign_key: "writer_id"
scope :males, -> { where(:gender => 'M') }
scope :females, -> { where(:gender => 'F') }