-
Notifications
You must be signed in to change notification settings - Fork 0
duncanbeevers/default_scope
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Default scope allows you to define a scope applied to every query on a model. class User < ActiveRecord::Base default_scope :conditions => { :banned => false } end User.find(:first) > 'SELECT * FROM `users` WHERE `users`.`banned` = 0' LIMIT 1; To execute queries outside the default scope, use with_exclusive_scope User.with_exclusive_scope do find(:first) end
About
Rails Plugin: define a scope applied to every query on a model
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published