Skip to content

Commit d98ebce

Browse files
committed
Rework method to reflect intent but avoid rubocop
1 parent 9dfe955 commit d98ebce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/rspec/active_model/mocks/mocks.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,11 @@ def self.param_delimiter; "-"; end
176176
end unless stubs.key?(:has_attribute?)
177177

178178
msingleton.__send__(:define_method, :respond_to?) do |method_name, *args|
179+
return true if __model_class_has_column?(method_name)
180+
179181
include_private = args.first || false
180-
__model_class_has_column?(method_name) ? true : super(method_name, include_private)
182+
183+
super(method_name, include_private)
181184
end unless stubs.key?(:respond_to?)
182185

183186
msingleton.__send__(:define_method, :method_missing) do |missing_m, *a, &b|

0 commit comments

Comments
 (0)