metamaps--metamaps/config/initializers/access_codes.rb
2017-11-25 11:23:47 -08:00

8 lines
271 B
Ruby

# frozen_string_literal: true
$codes = []
if ActiveRecord::Base.connection.data_source_exists? 'users'
$codes = ActiveRecord::Base.connection
.execute('SELECT code FROM users')
.map { |user| user['code'] }
end