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

9 lines
271 B
Ruby
Raw Permalink Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
2017-11-25 19:23:47 +00:00
$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