aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-02 16:42:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-02 16:42:42 -0700
commite1467333a1ad3e09ee1443d2d2f1101f14ac9902 (patch)
tree1898f4ce04b1fa89552f39b83d656aef08266e2d
parent781390551b4a7a6b1c7df6486bf0019ac1eff5ba (diff)
downloadrails-e1467333a1ad3e09ee1443d2d2f1101f14ac9902.tar.gz
rails-e1467333a1ad3e09ee1443d2d2f1101f14ac9902.tar.bz2
rails-e1467333a1ad3e09ee1443d2d2f1101f14ac9902.zip
remove some duplicate code
-rw-r--r--activerecord/lib/active_record/associations/builder/association.rb9
1 files changed, 1 insertions, 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