Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move macro to class level

  • Loading branch information...
commit a929d78d7b4a1341c0ed538cdcce0b381f410a35 1 parent 3c27b6e
@rafaelfranca rafaelfranca authored
View
4 activerecord/lib/active_record/associations/builder/association.rb
@@ -53,10 +53,10 @@ def initialize(name, scope, options, extension)
end
def build(model)
- ActiveRecord::Reflection.create(macro, name, scope, options, model)
+ ActiveRecord::Reflection.create(self.class.macro, name, scope, options, model)
end
- def macro
+ def self.macro
raise NotImplementedError
end
View
2  activerecord/lib/active_record/associations/builder/belongs_to.rb
@@ -1,6 +1,6 @@
module ActiveRecord::Associations::Builder
class BelongsTo < SingularAssociation #:nodoc:
- def macro
+ def self.macro
:belongs_to
end
View
2  activerecord/lib/active_record/associations/builder/has_many.rb
@@ -1,6 +1,6 @@
module ActiveRecord::Associations::Builder
class HasMany < CollectionAssociation #:nodoc:
- def macro
+ def self.macro
:has_many
end
View
2  activerecord/lib/active_record/associations/builder/has_one.rb
@@ -1,6 +1,6 @@
module ActiveRecord::Associations::Builder
class HasOne < SingularAssociation #:nodoc:
- def macro
+ def self.macro
:has_one
end
Please sign in to comment.
Something went wrong with that request. Please try again.