From e1467333a1ad3e09ee1443d2d2f1101f14ac9902 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 2 Oct 2013 16:42:42 -0700 Subject: remove some duplicate code --- .../lib/active_record/associations/builder/association.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index a8cde62642..4066a1c9d3 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -21,14 +21,7 @@ module ActiveRecord::Associations::Builder attr_reader :name, :scope, :options def self.build(model, name, scope, options, &block) - raise ArgumentError, "association names must be a Symbol" unless name.kind_of?(Symbol) - - if scope.is_a?(Hash) - options = scope - scope = nil - end - - builder = new(name, scope, options, &block) + builder = create_builder model, name, scope, options, &block reflection = builder.build(model) builder.define_accessors model, reflection define_callbacks model, reflection -- cgit v1.2.3