1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #14098 from Amit-Thawait/master

Typo fix for unscope [ci skip]
This commit is contained in:
Arthur Nogueira Neves 2014-02-18 14:33:25 -05:00
commit 5dc6bf5fbc
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@
class User < ActiveRecord::Base
default_scope { where state: 'pending' }
scope :active, -> { unescope(where: :state).where(state: 'active') }
scope :active, -> { unscope(where: :state).where(state: 'active') }
scope :inactive, -> { rewhere state: 'inactive' }
end

View file

@ -315,7 +315,7 @@ To get the previous behavior it is needed to explicitly remove the
```ruby
class User < ActiveRecord::Base
default_scope { where state: 'pending' }
scope :active, -> { unescope(where: :state).where(state: 'active') }
scope :active, -> { unscope(where: :state).where(state: 'active') }
scope :inactive, -> { rewhere state: 'inactive' }
end