Skip to content

Commit

Permalink
Removing unique option
Browse files Browse the repository at this point in the history
  • Loading branch information
Winton Welsh committed Aug 3, 2008
1 parent 3f586b5 commit cfebf2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/acts_as_relationable.rb
@@ -1,6 +1,6 @@
module ActiveRecord
module Acts #:nodoc:
module Relationable #:nodoc:
module Acts
module Relationable

MODELS = Dir[RAILS_ROOT + "/app/models/*.rb"].collect { |f| File.basename f, '.rb' }

Expand Down Expand Up @@ -37,7 +37,7 @@ def acts_as_relationable(*types)
select = "#{table}.*, relationships.id AS relationship_id#{fields.empty? ? '' : ', '}" + fields.collect { |f| "relationships.#{f}" }.join(', ')

has_many 'parent_' + type,
:select => select, :conditions => sql, :through => :parent_relationships, :uniq => unique,
:select => select, :conditions => sql, :through => :parent_relationships,
:source => :parent, :class_name => type.classify, :source_type => table.classify do
fields.each do |field|
define_method field.to_s.pluralize do |value|
Expand All @@ -48,7 +48,7 @@ def acts_as_relationable(*types)
end

has_many 'child_' + type,
:select => select, :conditions => sql, :through => :child_relationships, :uniq => unique,
:select => select, :conditions => sql, :through => :child_relationships,
:source => :child, :class_name => type.classify, :source_type => table.classify do
fields.each do |field|
define_method field.to_s.pluralize do |value|
Expand Down

0 comments on commit cfebf2e

Please sign in to comment.