Created
July 1, 2010 22:33
-
-
Save tammersaleh/460670 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MyScopes | |
def self.included(base) | |
base.send(:scope, :blue, lambda { where("color = blue") }) | |
end | |
end | |
class ActiveRecord::Base | |
include MyScopes | |
end |
This file contains hidden or 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
...activerecord-3.0.0.beta4/lib/active_record/base.rb:1236:in `class_of_active_record_descendant': undefined method `abstract_class?' for Object:Class (NoMethodError) |
This file contains hidden or 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
undefined method `where' for MyScopes:Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment