Created
December 20, 2011 18:57
-
-
Save knewter/1502764 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
class Foo < ActiveRecord::Base | |
scope :bar, lambda{|a| where(a: a) } | |
scope :baz, lambda{|b| where(b: b) } | |
end | |
# Foo.bar(a).baz(b) works fine. | |
class Foo < ActiveRecord::Base | |
class << self | |
def bar(a) | |
where(a: a) | |
end | |
def baz(b) | |
where(b: b) | |
end | |
end | |
end | |
# What does Foo.bar(a).baz(b) do here? seems like it wouldn't work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment