Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'active_record'
- # Rails で言うところの config/database.yml
- ActiveRecord::Base.establish_connection(
- adapter: 'mysql2',
- host: 'localhost',
- username: 'username',
- password: 'password',
- database: 'database',
- # ....
- )
- # 使いたいテーブルのモデル
- class User < ActiveRecord::Base
- # relation とか
- end
- # ...
Add Comment
Please, Sign In to add comment