I'm new to rails / ruby, and I was wondering how I can check if my database schema is built correctly in the rails console.
In rails c
ActiveRecord::Base.connection.tables gave me the output
["schema_migrations", "users", "expense_pictures", "income_pictures", "income_texts", "expense_texts"]
How can I verify in the console that I have correctly built the following circuit?

From the user to IncomePictures and ExpensePictures, foreign keys are used. IncomePictures to ExpensePictures are also foreign keys to their respective texts.
Here are my models:
class ExpensePicture < ActiveRecord::Base belongs_to :user mount_uploader :image, ImageUploader has_one :expense_text end class ExpenseText < ActiveRecord::Base belongs_to :expense_pictures end class IncomePicture < ActiveRecord::Base belongs_to :user mount_uploader :image, ImageUploader has_one :income_text end class IncomeText < ActiveRecord::Base belongs_to :income_pictures end class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :rememberable, :validatable has_many :expense_pictures has_many :income_pictures end
source share