Created
January 8, 2015 12:29
-
-
Save mbrock/a0ff24513bbb4d8dcc12 to your computer and use it in GitHub Desktop.
NoBrainer: error using default_scope in subclass
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
require 'nobrainer' | |
NoBrainer.configure do |config| | |
config.app_name = "default-scope-on-subclass-test" | |
end | |
class Thing | |
include NoBrainer::Document | |
end | |
class Subthing < Thing | |
include NoBrainer::Document | |
default_scope { order_by(:id) } | |
end | |
# /var/lib/gems/2.1.0/gems/nobrainer-0.20.0/lib/no_brainer/document/criteria.rb:46:in `default_scope': store_in() must be called on the parent class (RuntimeError) | |
# from test.rb:13:in `<class:Subthing>' | |
# from test.rb:11:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment