diff options
Diffstat (limited to 'db/config.rb')
-rw-r--r-- | db/config.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/config.rb b/db/config.rb new file mode 100644 index 0000000..55b4106 --- /dev/null +++ b/db/config.rb @@ -0,0 +1,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 |