Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------
- # database.yml
- ------------------------------------
- default: &default
- adapter: postgresql
- encoding: unicode
- pool: 5
- timeout: 5000
- username: user
- password:
- host: 127.0.0.1
- port: 5432
- min_messages: WARNING
- development:
- <<: *default
- database: database_statistic
- staging:
- <<: *default
- database: database_statistic
- test:
- <<: *default
- database: database_statistic
- production:
- adapter: postgresql
- encoding: unicode
- database: database_statistic_production
- pool: 5
- timeout: 5000
- username: deploy
- password: (secret)
- host: 127.0.0.1
- port: 5433
- min_messages: WARNING
- sqlite_default: &sqlite_default
- adapter: sqlite3
- pool: 5
- timeout: 5000
- sqlite_development:
- <<: *sqlite_default
- database: /tmp/db_statistic.db
- sqlite_test:
- <<: *sqlite_default
- database: /tmp/db_statistic.db
- sqlite_staging:
- <<: *sqlite_default
- database: /tmp/db_statistic.db
- sqlite_production:
- <<: *sqlite_default
- database: /tmp/db_statistic.db
- ------------------------------------
- # app/models/report.rb => postgresql
- ------------------------------------
- # == Schema Information
- #
- # Table name: report
- #
- # id :integer not null, primary key
- # session_id :integer not null
- # timestamp :text not null
- class Report < ApplicationRecord
- self.table_name = "report"
- validates :value, presence: true
- end
- ------------------------------------
- # app/models/report_statistic.rb => sqlite
- ------------------------------------
- # == Schema Information
- #
- # Table name: report_statistic
- #
- # id :integer not null, primary key
- # session_id :integer not null
- # timestamp :text not null
- class ReportStatistic < ApplicationRecord
- establish_connection "sqlite_#{Rails.env}".to_sym
- self.abstract_class = true
- self.table_name = "report_statistic"
- validates :value, presence: true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement