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

4 lines
No EOL
177 B
Ruby

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