File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change
1
+ * [ #1522 ] ( https://github.com/rubocop/rubocop-rails/pull/1522 ) : Fix an error for ` Rails/FindBy ` when ` where ` takes a block. ([ @earlopain ] [ ] )
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def on_send(node)
46
46
private
47
47
48
48
def where_method? ( receiver )
49
- return false unless receiver
49
+ return false if ! receiver || receiver . any_block_type?
50
50
51
51
receiver . respond_to? ( :method? ) && receiver . method? ( :where )
52
52
end
Original file line number Diff line number Diff line change 103
103
RUBY
104
104
end
105
105
106
+ it 'does not register an offense when where takes a block' do
107
+ expect_no_offenses ( <<~RUBY )
108
+ where { foo }.take
109
+ RUBY
110
+ end
111
+
106
112
context 'when `IgnoreWhereFirst: true' do
107
113
let ( :cop_config ) do
108
114
{ 'IgnoreWhereFirst' => true }
You can’t perform that action at this time.
0 commit comments