Skip to content

Commit

Permalink
fix union
Browse files Browse the repository at this point in the history
  • Loading branch information
hooopo committed Nov 27, 2019
1 parent 4aa3dad commit 3a92eb2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion lib/user_name_suggester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.find_available_username_based_on(name, allowed_username = nil)
}

# increasing the search space a bit to allow for some extra noise
gs = 1..count.map do |c|
gs = (1..count).map do |c|
"SELECT #{c} AS n"
end.join(" UNION ")
available = DB.query_single(<<~SQL, params).first
Expand Down
2 changes: 0 additions & 2 deletions spec/models/screened_ip_address_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def test_bad_value(arg)
describe '#watch' do
context 'ip_address is not being watched' do
it 'should create a new record' do
pending
record = described_class.watch(ip_address)
expect(record).not_to be_new_record
expect(record.action_type).to eq(described_class.actions[:block])
Expand All @@ -121,7 +120,6 @@ def test_bad_value(arg)
end

it "a record with subnet mask exists, but doesn't match" do
pending
existing = Fabricate(:screened_ip_address, ip_address: '99.232.23.124/24')
expect { described_class.watch('99.232.55.124') }.to change { described_class.count }
end
Expand Down

0 comments on commit 3a92eb2

Please sign in to comment.