mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 23:25:31 +08:00
Add global settings base class [SCI-1004]
This commit is contained in:
parent
c963674e49
commit
2aba0f46a6
2 changed files with 12 additions and 0 deletions
3
app/models/settings.rb
Normal file
3
app/models/settings.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Settings < ActiveRecord::Base
|
||||
private_class_method :new
|
||||
end
|
9
db/migrate/20170217141402_create_settings_table.rb
Normal file
9
db/migrate/20170217141402_create_settings_table.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class CreateSettingsTable < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :settings do |t|
|
||||
t.text :type, null: false
|
||||
t.jsonb :values, null: false, default: '{}'
|
||||
end
|
||||
add_index(:settings, :type, unique: true)
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue