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

5 lines
180 B
Ruby
Raw Normal View History

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