Skip to content
Browse files

remove some duplicate code

  • Loading branch information...
1 parent 7813905 commit e1467333a1ad3e09ee1443d2d2f1101f14ac9902 @tenderlove tenderlove committed Oct 2, 2013
Showing with 1 addition and 8 deletions.
  1. +1 −8 activerecord/lib/active_record/associations/builder/association.rb
View
9 activerecord/lib/active_record/associations/builder/association.rb
@@ -21,14 +21,7 @@ class << self
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

0 comments on commit e146733

Please sign in to comment.
Something went wrong with that request. Please try again.