diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-08-03 10:50:49 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-08-03 11:05:31 +0100 |
commit | bf2df6e7ba495ac4d2264e0e2558c366f217ee5d (patch) | |
tree | 775ae427819b2200b0ae3c85619d4f5cc8f8c203 /activerecord/test/fixtures/.gitignore | |
parent | c391919180a19a31a04b9483396d0543a4bed961 (diff) | |
download | rails-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/fixtures/.gitignore')
0 files changed, 0 insertions, 0 deletions