aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-08-03 10:50:49 +0100
committerJon Leighton <j@jonathanleighton.com>2012-08-03 11:05:31 +0100
commitbf2df6e7ba495ac4d2264e0e2558c366f217ee5d (patch)
tree775ae427819b2200b0ae3c85619d4f5cc8f8c203 /activerecord/test/cases/attribute_methods_test.rb
parentc391919180a19a31a04b9483396d0543a4bed961 (diff)
downloadrails-bf2df6e7ba495ac4d2264e0e2558c366f217ee5d.tar.gz
rails-bf2df6e7ba495ac4d2264e0e2558c366f217ee5d.tar.bz2
rails-bf2df6e7ba495ac4d2264e0e2558c366f217ee5d.zip
Allow Relation#merge to take a proc.
This was requested by DHH to allow creating of one's own custom association macros. For example: module Commentable def has_many_comments(extra) has_many :comments, -> { where(:foo).merge(extra) } end end class Post < ActiveRecord::Base extend Commentable has_many_comments -> { where(:bar) } end
Diffstat (limited to 'activerecord/test/cases/attribute_methods_test.rb')
0 files changed, 0 insertions, 0 deletions