aboutsummaryrefslogtreecommitdiff
path: root/interfaces/ruby/models/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces/ruby/models/config.rb')
-rw-r--r--interfaces/ruby/models/config.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/interfaces/ruby/models/config.rb b/interfaces/ruby/models/config.rb
new file mode 100644
index 0000000..55b4106
--- /dev/null
+++ b/interfaces/ruby/models/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