aboutsummaryrefslogtreecommitdiff
path: root/db/config.rb
blob: 55b41065a3782ccfda9c3b24f018d1b3d31a2865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Config < ActiveRecord::Base
  self.table_name = 'config'
  validates_presence_of :title
  validates_presence_of :timezone
  validates_presence_of :postsperpage
end

class CreateConfigTable < ActiveRecord::Migration[6.0]
  def change
    create_table :config do |t|
      t.string :title, null: false
      t.string :subtitle
      t.string :timezone, null: false
      t.integer :postsperpage, null: false
    end
  end
end