Add models
This commit is contained in:
parent
28ddfa2f57
commit
12c7dbebe2
6 changed files with 33 additions and 0 deletions
2
app/controllers/letters_controller.rb
Normal file
2
app/controllers/letters_controller.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
class LettersController < ApplicationController
|
||||||
|
end
|
2
app/controllers/signatories_controller.rb
Normal file
2
app/controllers/signatories_controller.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
class SignatoriesController < ApplicationController
|
||||||
|
end
|
3
app/models/letter.rb
Normal file
3
app/models/letter.rb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class Letter < ApplicationRecord
|
||||||
|
has_one_attached :document
|
||||||
|
end
|
2
app/models/signatory.rb
Normal file
2
app/models/signatory.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
class Signatory < ApplicationRecord
|
||||||
|
end
|
12
db/migrate/20240608185124_create_letters.rb
Normal file
12
db/migrate/20240608185124_create_letters.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
class CreateLetters < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
create_table :letters do |t|
|
||||||
|
t.string :title
|
||||||
|
t.string :author
|
||||||
|
t.string :email
|
||||||
|
t.boolean :private_email
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
12
db/migrate/20240608191006_create_signatories.rb
Normal file
12
db/migrate/20240608191006_create_signatories.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
class CreateSignatories < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
create_table :signatories do |t|
|
||||||
|
t.string :name
|
||||||
|
t.string :profession
|
||||||
|
t.string :email
|
||||||
|
t.boolean :private_email
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue