Skip to content

Instantly share code, notes, and snippets.

@mbrock
Created January 8, 2015 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrock/a0ff24513bbb4d8dcc12 to your computer and use it in GitHub Desktop.
Save mbrock/a0ff24513bbb4d8dcc12 to your computer and use it in GitHub Desktop.
NoBrainer: error using default_scope in subclass
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