Skip to content

Commit

Permalink
Change options interface
Browse files Browse the repository at this point in the history
  • Loading branch information
David Faber committed Jan 6, 2009
1 parent eb6d8df commit 6596da0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2,864 deletions.
4 changes: 2 additions & 2 deletions lib/delegate_belongs_to.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ module ClassMethods
# delegate_belongs_to :contact, [:defaults] ## same as above, and useless
# delegate_belongs_to :contact, [:defaults, :address, :fullname], :class_name => 'VCard'
##
def delegate_belongs_to(association, attrs=[], opts={})
attrs ||= []
def delegate_belongs_to(association, *attrs)
opts = attrs.extract_options!
initialize_association :belongs_to, association, opts
attrs = get_association_column_names(association) if attrs.empty?
attrs.concat get_association_column_names(association) if attrs.delete :defaults
Expand Down
Loading

0 comments on commit 6596da0

Please sign in to comment.