annotate models
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
Mohammad Kanaan 2026-05-25 19:15:06 +03:00
parent 5b56b091b4
commit 22c7e0cdb6
23 changed files with 427 additions and 1 deletions

65
.annotaterb.yml Normal file
View file

@ -0,0 +1,65 @@
---
:position: before
:position_in_additional_file_patterns: before
:position_in_class: before
:position_in_factory: before
:position_in_fixture: before
:position_in_routes: before
:position_in_serializer: before
:position_in_test: before
:classified_sort: true
:exclude_controllers: true
:exclude_factories: false
:exclude_fixtures: false
:exclude_helpers: true
:exclude_scaffolds: true
:exclude_serializers: false
:exclude_sti_subclasses: false
:exclude_tests: false
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: false
:grouped_polymorphic: false
:ignore_model_sub_dir: false
:ignore_unknown_models: false
:include_version: false
:show_check_constraints: false
:show_complete_foreign_keys: false
:show_foreign_keys: true
:show_indexes: true
:show_indexes_include: false
:simple_indexes: false
:sort: false
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:position_of_column_comment: :with_name
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:timestamp_columns:
- created_at
- updated_at
:ignore_columns:
:ignore_routes:
:ignore_multi_database_name: false
:models: true
:routes: false
:skip_on_db_migrate: false
:target_action: :do_annotations
:wrapper:
:wrapper_close:
:wrapper_open:
:classes_default_to_s: []
:additional_file_patterns: []
:model_dir:
- app/models
:require: []
:root_dir:
- ''

View file

@ -1,2 +1,17 @@
# == Schema Information
#
# Table name: admins
#
# id :bigint not null, primary key
# email :string
# name :string
# password_digest :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_admins_on_email (email) UNIQUE
#
class Admin < ApplicationRecord class Admin < ApplicationRecord
end end

View file

@ -1,3 +1,12 @@
# == Schema Information
#
# Table name: chains
#
# id :bigint not null, primary key
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Chain < ApplicationRecord class Chain < ApplicationRecord
has_one_attached :image has_one_attached :image
end end

View file

@ -1,2 +1,12 @@
# == Schema Information
#
# Table name: guests
#
# id :bigint not null, primary key
# name :string
# username :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Guest < ApplicationRecord class Guest < ApplicationRecord
end end

View file

@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: moderation_logs
#
# id :bigint not null, primary key
# moderatable_type :string not null
# reason :string
# created_at :datetime not null
# updated_at :datetime not null
# admin_id :integer not null
# moderatable_id :integer not null
#
# Indexes
#
# index_moderation_logs_on_admin_id (admin_id)
# index_moderation_logs_on_moderatable (moderatable_type,moderatable_id)
#
# Foreign Keys
#
# fk_rails_... (admin_id => admins.id)
#
class ModerationLog < ApplicationRecord class ModerationLog < ApplicationRecord
belongs_to :moderatable, polymorphic: true belongs_to :moderatable, polymorphic: true
belongs_to :admin belongs_to :admin

View file

@ -1,3 +1,31 @@
# == Schema Information
#
# Table name: price_reports
#
# id :bigint not null, primary key
# discount_price :decimal(, )
# downvotes :integer
# price :decimal(, )
# reported_at :datetime
# upvotes :integer
# created_at :datetime not null
# updated_at :datetime not null
# guest_id :integer not null
# product_id :integer not null
# store_id :integer not null
#
# Indexes
#
# index_price_reports_on_guest_id (guest_id)
# index_price_reports_on_product_id (product_id)
# index_price_reports_on_store_id (store_id)
#
# Foreign Keys
#
# fk_rails_... (guest_id => guests.id)
# fk_rails_... (product_id => products.id)
# fk_rails_... (store_id => stores.id)
#
class PriceReport < ApplicationRecord class PriceReport < ApplicationRecord
belongs_to :product belongs_to :product
belongs_to :store belongs_to :store

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: products
#
# id :bigint not null, primary key
# barcode :string
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_products_on_barcode (barcode) UNIQUE
#
class Product < ApplicationRecord class Product < ApplicationRecord
has_one_attached :image has_one_attached :image
end end

View file

@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: stores
#
# id :bigint not null, primary key
# latitude :float
# longitude :float
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# chain_id :integer not null
#
# Indexes
#
# index_stores_on_chain_id (chain_id)
#
# Foreign Keys
#
# fk_rails_... (chain_id => chains.id)
#
class Store < ApplicationRecord class Store < ApplicationRecord
has_one_attached :image has_one_attached :image
belongs_to :chain belongs_to :chain

View file

@ -0,0 +1,10 @@
# This rake task was added by annotate_rb gem.
# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
require "annotate_rb"
# Can modify the config path here if needed - by default, it's .annotaterb.yml in the root of the project
# AnnotateRb::ConfigFinder.config_path = ""
AnnotateRb::Core.load_rake_tasks
end

View file

@ -1,5 +1,20 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: admins
#
# id :bigint not null, primary key
# email :string
# name :string
# password_digest :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_admins_on_email (email) UNIQUE
#
one: one:
name: MyString name: MyString
email: MyString email: MyString

View file

@ -1,5 +1,14 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: chains
#
# id :bigint not null, primary key
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
one: one:
name: MyString name: MyString

View file

@ -1,5 +1,15 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: guests
#
# id :bigint not null, primary key
# name :string
# username :string
# created_at :datetime not null
# updated_at :datetime not null
#
one: one:
username: MyString username: MyString
name: MyString name: MyString

View file

@ -1,5 +1,26 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: moderation_logs
#
# id :bigint not null, primary key
# moderatable_type :string not null
# reason :string
# created_at :datetime not null
# updated_at :datetime not null
# admin_id :integer not null
# moderatable_id :integer not null
#
# Indexes
#
# index_moderation_logs_on_admin_id (admin_id)
# index_moderation_logs_on_moderatable (moderatable_type,moderatable_id)
#
# Foreign Keys
#
# fk_rails_... (admin_id => admins.id)
#
one: one:
reason: MyString reason: MyString
moderatable: one moderatable: one

View file

@ -1,5 +1,33 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: price_reports
#
# id :bigint not null, primary key
# discount_price :decimal(, )
# downvotes :integer
# price :decimal(, )
# reported_at :datetime
# upvotes :integer
# created_at :datetime not null
# updated_at :datetime not null
# guest_id :integer not null
# product_id :integer not null
# store_id :integer not null
#
# Indexes
#
# index_price_reports_on_guest_id (guest_id)
# index_price_reports_on_product_id (product_id)
# index_price_reports_on_store_id (store_id)
#
# Foreign Keys
#
# fk_rails_... (guest_id => guests.id)
# fk_rails_... (product_id => products.id)
# fk_rails_... (store_id => stores.id)
#
one: one:
price: 9.99 price: 9.99
discount_price: 9.99 discount_price: 9.99

View file

@ -1,5 +1,19 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: products
#
# id :bigint not null, primary key
# barcode :string
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_products_on_barcode (barcode) UNIQUE
#
one: one:
name: MyString name: MyString
barcode: MyString barcode: MyString

View file

@ -1,5 +1,25 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# == Schema Information
#
# Table name: stores
#
# id :bigint not null, primary key
# latitude :float
# longitude :float
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# chain_id :integer not null
#
# Indexes
#
# index_stores_on_chain_id (chain_id)
#
# Foreign Keys
#
# fk_rails_... (chain_id => chains.id)
#
one: one:
name: MyString name: MyString
latitude: 1.5 latitude: 1.5

View file

@ -1,3 +1,18 @@
# == Schema Information
#
# Table name: admins
#
# id :bigint not null, primary key
# email :string
# name :string
# password_digest :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_admins_on_email (email) UNIQUE
#
require "test_helper" require "test_helper"
class AdminTest < ActiveSupport::TestCase class AdminTest < ActiveSupport::TestCase

View file

@ -1,3 +1,12 @@
# == Schema Information
#
# Table name: chains
#
# id :bigint not null, primary key
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
require "test_helper" require "test_helper"
class ChainTest < ActiveSupport::TestCase class ChainTest < ActiveSupport::TestCase

View file

@ -1,3 +1,13 @@
# == Schema Information
#
# Table name: guests
#
# id :bigint not null, primary key
# name :string
# username :string
# created_at :datetime not null
# updated_at :datetime not null
#
require "test_helper" require "test_helper"
class GuestTest < ActiveSupport::TestCase class GuestTest < ActiveSupport::TestCase

View file

@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: moderation_logs
#
# id :bigint not null, primary key
# moderatable_type :string not null
# reason :string
# created_at :datetime not null
# updated_at :datetime not null
# admin_id :integer not null
# moderatable_id :integer not null
#
# Indexes
#
# index_moderation_logs_on_admin_id (admin_id)
# index_moderation_logs_on_moderatable (moderatable_type,moderatable_id)
#
# Foreign Keys
#
# fk_rails_... (admin_id => admins.id)
#
require "test_helper" require "test_helper"
class ModerationLogTest < ActiveSupport::TestCase class ModerationLogTest < ActiveSupport::TestCase

View file

@ -1,3 +1,31 @@
# == Schema Information
#
# Table name: price_reports
#
# id :bigint not null, primary key
# discount_price :decimal(, )
# downvotes :integer
# price :decimal(, )
# reported_at :datetime
# upvotes :integer
# created_at :datetime not null
# updated_at :datetime not null
# guest_id :integer not null
# product_id :integer not null
# store_id :integer not null
#
# Indexes
#
# index_price_reports_on_guest_id (guest_id)
# index_price_reports_on_product_id (product_id)
# index_price_reports_on_store_id (store_id)
#
# Foreign Keys
#
# fk_rails_... (guest_id => guests.id)
# fk_rails_... (product_id => products.id)
# fk_rails_... (store_id => stores.id)
#
require "test_helper" require "test_helper"
class PriceReportTest < ActiveSupport::TestCase class PriceReportTest < ActiveSupport::TestCase

View file

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: products
#
# id :bigint not null, primary key
# barcode :string
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_products_on_barcode (barcode) UNIQUE
#
require "test_helper" require "test_helper"
class ProductTest < ActiveSupport::TestCase class ProductTest < ActiveSupport::TestCase

View file

@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: stores
#
# id :bigint not null, primary key
# latitude :float
# longitude :float
# name :string
# created_at :datetime not null
# updated_at :datetime not null
# chain_id :integer not null
#
# Indexes
#
# index_stores_on_chain_id (chain_id)
#
# Foreign Keys
#
# fk_rails_... (chain_id => chains.id)
#
require "test_helper" require "test_helper"
class StoreTest < ActiveSupport::TestCase class StoreTest < ActiveSupport::TestCase