diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-13 18:43:55 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-13 18:55:46 +0100 |
commit | 09d2f168e603baa979f209be79d2dff7053d052d (patch) | |
tree | f78000b90bce20f35e78199891f681f8a9e11285 /activerecord/lib/active_record/associations/builder/belongs_to.rb | |
parent | c733b8e985d342435d6978ee3b806daa84ec64d6 (diff) | |
download | rails-09d2f168e603baa979f209be79d2dff7053d052d.tar.gz rails-09d2f168e603baa979f209be79d2dff7053d052d.tar.bz2 rails-09d2f168e603baa979f209be79d2dff7053d052d.zip |
stop using class_attribute where methods/inheritance will suffice.
Diffstat (limited to 'activerecord/lib/active_record/associations/builder/belongs_to.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/belongs_to.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb index 4183c222de..4bef996297 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -2,9 +2,13 @@ require 'active_support/core_ext/object/inclusion' module ActiveRecord::Associations::Builder class BelongsTo < SingularAssociation #:nodoc: - self.macro = :belongs_to + def macro + :belongs_to + end - self.valid_options += [:foreign_type, :polymorphic, :touch] + def valid_options + super + [:foreign_type, :polymorphic, :touch] + end def constructable? !options[:polymorphic] |