This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
class Reflection::AssociationReflection | |
# Return a named scope instead of the bare ActiveRecord::Base subclass. | |
def klass_with_scope | |
k = klass_without_scope | |
options[:scope].nil? ? k : k.send(options[:scope]) | |
end | |
alias_method_chain :klass, :scope | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb | |
index 7f78191..e55b639 100755 | |
--- a/activerecord/lib/active_record/associations.rb | |
+++ b/activerecord/lib/active_record/associations.rb | |
@@ -1557,7 +1557,8 @@ module ActiveRecord | |
:finder_sql, :counter_sql, | |
:before_add, :after_add, :before_remove, :after_remove, | |
:extend, :readonly, | |
- :validate | |
+ :validate, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tag | |
has_many :taggings | |
end | |
class Tagging | |
belongs_to :tag | |
belongs_to :posts | |
# uses a string 'flag' column but could be changed to a boolean important | |
# column later, hence the need to encapsulate! |
NewerOlder