Rich Many-to-Many Assocations
Tables: AdminUser and Section
create_table "admin_users", force: :cascade do |t|
t.string "first_name", limit: 25
t.string "last_name", limit: 50
t.string "email", default: "", null: false
t.string "hashed_password", limit: 40
t.string "username"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "sections", force: :cascade do |t|
t.integer "page_id"
t.string "name"
t.integer "position"
t.boolean "visible", default: false
t.string "content_type"
t.text "content"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["page_id"], name: "index_sections_on_page_id"
end
Assocations: admin_users
, sections
, section_edits
AdminUser has_many :section_edits
AdminUser has_many :sections, through: :section_edits
SectionEdit belongs_to :admin_user
Section has_many :section_edits
Section has_many :admin_users, through: :section_edits
SectionEdit belongs_to :section
Tables
admin_users | section_edits | sections |
---|---|---|
id | admin_id | |
section_id | id |
Published on 29 Mar 2020
all tags
100daysofcode activerecord android annoyances api apt arch array artix atom az3w backend bash blog browser bug callback career ci-cd cli cloud code coding config configuration cp crud cryptography css csv database db design devops django docker email erp feelsgood filter fugitive gif gist git gnome gnome pomodoro grep hebrew http ide isbn-fetcher iso javascript job search js kanban kindle koans learning linkedin linux logger manjaro map markdown microservices mobi mtp neovim nodejs nvchad packages panda pastbin patch portfolio post postgres pytest python rails reduce refactoring reflections rest routes rspec ruby salesforce script scripting security sed shell sql string_replacement study tdd terminal testing tmux ttd version_control vim vim sort walkthrough webdev workflow zsh