Skip to content

Instantly share code, notes, and snippets.

@bibstha
Last active August 29, 2015 14:16
Show Gist options
  • Save bibstha/361960cef0c2da683e65 to your computer and use it in GitHub Desktop.
Save bibstha/361960cef0c2da683e65 to your computer and use it in GitHub Desktop.
class A
def self.scope(scope_val)
@scope_val = scope_val
end
def self.scope_val
@scope_val
end
scope :my_fancy_scope
end
p A.scope_val # prints my_fancy_scope
p Class.new(A).scope_val # prints nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment