metamaps--metamaps/config/initializers/access_codes.rb
2016-09-24 11:00:46 +08:00

5 lines
210 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