metamaps--metamaps/config/initializers/access_codes.rb

8 lines
270 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
$codes = []
if ActiveRecord::Base.connection.data_source_exists? 'users'
2016-09-24 04:27:34 +00:00
$codes = ActiveRecord::Base.connection
.execute('SELECT code FROM users')
.map { |user| user['code'] }
end