Column | Type | Options |
---|---|---|
name | string | null: false, unique: true |
string | null: false, unique: true | |
string | ||
image | string |
- has_many :relationships, dependent: :destroy
- has_many :memos, dependent: :destroy
- has_many:notes, dependent: :destroy
- has_many:comments, dependent: :destroy
- has_many:likes, dependent: :destroy
- has_one :config, dependent: :destroy
Column | Type | Options |
---|---|---|
user_id | integer | foreign_key: true, null:false |
follow_id | integer | foreign_key: {to_table: users}, null:false |
- belongs_to :user
- belongs_to :follow
Column | Type | Options |
---|---|---|
user_id | integer | foreign_key: true, null:false |
plan | integer | null:false |
remind | integer | null:false |
publishing | integer | null:false |
theme | string |
- belongs_to :user
Column | Type | Options |
---|---|---|
user_id | integer | foreign_key: true, null:false |
memo | string | null:false |
- belongs_to :user
- has_one :note
Column | Type | Options |
---|---|---|
user_id | integer | foreign_key: true, null:false |
memo_id | integer | foreign_key: true, null:false |
what | string | |
why | string | |
feeling_detail | string | |
challenge | string |
- belongs_to :user
- belongs_to :memo
- has_many :comments, dependent: :destroy
- has_many :likes, dependent: :destroy
- has_many :note_feelings
- has_many :feelings, through: :note_feelings
Column | Type | Options |
---|---|---|
note_id | integer | foreign_key: true, null:false |
feeling_id | integer | foreign_key: true, null:false |
- belongs_to :note
- belongs_to :feeling
Column | Type | Options |
---|---|---|
feel | integer | |
image | string |
- has_many :note_feelings
- has_many :notes, throug: :note_feelings
Column | Type | Options |
---|---|---|
glasses | string | |
tutorial | string |
none
Column | Type | Options |
---|---|---|
user_id | integer | foreign_key: true, null:false |
note_id | integer | foreign_key: true, null:false |
comment | strig | null:false |
- belongs_to :user
- belongs_to :note
Column | Type | Options |
---|---|---|
user_id | integer | null: false, foreign_key: true |
note_id | integer | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :note
- validates_uniqueness_of :post_id, scope: :user_id