Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created August 16, 2012 15:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonroelofs/3370968 to your computer and use it in GitHub Desktop.
Save jasonroelofs/3370968 to your computer and use it in GitHub Desktop.
default_scope is evil, EVIL!
] rails c
Loading development environment (Rails 3.2.8)
1.9.3p194 :001 > User.new
=> #<User id: nil, test_field: "Johnson">
class User < ActiveRecord::Base
default_scope where(:test_field => "Johnson")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment