From 8f390a25da3fadabc653fa6a2526ed4754a04f34 Mon Sep 17 00:00:00 2001 From: Nenad Vujicic Date: Fri, 31 Jan 2025 19:00:11 +0100 Subject: [PATCH] Adds OldNote model file Adds OldNote model file for modeling one row of old_notes table. Also, added author association for connecting with users table. --- app/models/old_note.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/models/old_note.rb diff --git a/app/models/old_note.rb b/app/models/old_note.rb new file mode 100644 index 0000000000..dce43bc322 --- /dev/null +++ b/app/models/old_note.rb @@ -0,0 +1,28 @@ +# == Schema Information +# +# Table name: old_notes +# +# note_id :bigint(8) not null, primary key +# latitude :integer not null +# longitude :integer not null +# tile :bigint(8) not null +# timestamp :datetime not null +# status :enum not null +# description :text default(""), not null +# user_id :bigint(8) +# user_ip :inet +# version :bigint(8) default(1), not null, primary key +# +# Indexes +# +# index_old_notes_on_version (version) +# +# Foreign Keys +# +# old_notes_note_id_fkey (note_id => notes.id) +# old_notes_user_id_fkey (user_id => users.id) +# + +class OldNote < ApplicationRecord + belongs_to :author, :class_name => "User", :foreign_key => "user_id", :optional => true +end