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:
commit
5dc6bf5fbc
2 changed files with 2 additions and 2 deletions
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
default_scope { where state: 'pending' }
|
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' }
|
scope :inactive, -> { rewhere state: 'inactive' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ To get the previous behavior it is needed to explicitly remove the
|
||||||
```ruby
|
```ruby
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
default_scope { where state: 'pending' }
|
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' }
|
scope :inactive, -> { rewhere state: 'inactive' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue