Skip to content

Commit

Permalink
Move method and attribute reader to private scope
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Dec 13, 2024
1 parent c6f9f60 commit 383ec50
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions spec/support/matchers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ module Matchers
class Base
include ActiveRecord::Sanitization::ClassMethods

attr_reader :table

def matches?(table)
table = table.table_name if table.respond_to?(:table_name)
@table = table
end
private :matches? # This is an abstract class

def failure_message_for_should_not
failure_message_for_should.gsub('to ', 'to not ')
end
Expand Down Expand Up @@ -55,6 +47,13 @@ def select_rows(sql, binds, name = nil)

private

attr_reader :table

def matches?(table)
table = table.table_name if table.respond_to?(:table_name)
@table = table
end

def exec_query(sql, binds, name)
sql = sanitize_sql_array([sql, *Array.wrap(binds)])
connection.exec_query(sql, name)
Expand Down

0 comments on commit 383ec50

Please # to comment.