Skip to content

Commit

Permalink
install annotate gem (#725)
Browse files Browse the repository at this point in the history
* install annotate gem

* add anotate

---------

Co-authored-by: usernaimandrey <anshlyapnikov@yandex.ru>
  • Loading branch information
liz4chernyshova and usernaimandrey committed Feb 22, 2024
1 parent 7cf9589 commit cef8f47
Show file tree
Hide file tree
Showing 69 changed files with 1,643 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ group :development, :test do
end

group :development do
gem 'annotate'
gem 'ruby-lsp-rails'
gem 'yard'
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ GEM
activerecord (>= 6.1, < 7.2)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ast (2.4.2)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
Expand Down Expand Up @@ -564,6 +567,7 @@ DEPENDENCIES
aasm
active_form_model (~> 0.4.1)
acts-as-taggable-on
annotate
bootsnap
bootstrap
browser
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ lint-style:
linter-code-fix:
bundle exec rubocop -A

editor-setup:
bundle exec annotate --models

deploy:
git push heroku main

Expand Down
1 change: 1 addition & 0 deletions annotate_models
Submodule annotate_models added at a7cc62
16 changes: 16 additions & 0 deletions app/models/career.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: careers
#
# id :integer not null, primary key
# description :text not null
# locale :string not null
# name :string not null
# slug :string not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_careers_on_slug (slug) UNIQUE
#
class Career < ApplicationRecord
extend Enumerize
include CareerRepository
Expand Down
22 changes: 22 additions & 0 deletions app/models/career/item.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: career_items
#
# id :integer not null, primary key
# order :integer
# created_at :datetime not null
# updated_at :datetime not null
# career_id :integer not null
# career_step_id :integer not null
#
# Indexes
#
# index_career_items_on_career_id_and_career_step_id (career_id,career_step_id) UNIQUE
# index_career_items_on_career_id_and_order (career_id,order) UNIQUE
# index_career_items_on_career_step_id (career_step_id)
#
# Foreign Keys
#
# career_id (career_id => careers.id)
# career_step_id (career_step_id => career_steps.id)
#
class Career::Item < ApplicationRecord
include Career::ItemRepository

Expand Down
23 changes: 23 additions & 0 deletions app/models/career/member.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: career_members
#
# id :integer not null, primary key
# finished_at :datetime
# state :string not null
# created_at :datetime not null
# updated_at :datetime not null
# career_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_career_members_on_career_id (career_id)
# index_career_members_on_user_id (user_id)
# index_career_members_on_user_id_and_career_id (user_id,career_id) UNIQUE WHERE state = 'active'
#
# Foreign Keys
#
# career_id (career_id => careers.id)
# user_id (user_id => users.id)
#
class Career::Member < ApplicationRecord
include StateConcern
include Career::MemberRepository
Expand Down
15 changes: 15 additions & 0 deletions app/models/career/member/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: career_member_versions
#
# id :integer not null, primary key
# event :string not null
# item_type :string not null
# whodunnit :string
# created_at :datetime
# item_id :bigint not null
#
# Indexes
#
# index_career_member_versions_on_item_type_and_item_id (item_type,item_id)
#
class Career::Member::Version < PaperTrail::Version
extend Enumerize

Expand Down
14 changes: 14 additions & 0 deletions app/models/career/step.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: career_steps
#
# id :integer not null, primary key
# description :text not null
# locale :string not null
# name :string not null
# notification_kind :string
# review_needed :boolean
# tasks_text :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
class Career::Step < ApplicationRecord
extend Enumerize
include Career::StepRepository
Expand Down
21 changes: 21 additions & 0 deletions app/models/career/step/member.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: career_step_members
#
# id :integer not null, primary key
# state :string not null
# created_at :datetime not null
# updated_at :datetime not null
# career_member_id :integer not null
# career_step_id :integer not null
#
# Indexes
#
# index_career_step_members_on_career_step_id (career_step_id)
# index_career_step_members_on_member_id_and_step_id (career_member_id,career_step_id) UNIQUE
#
# Foreign Keys
#
# career_member_id (career_member_id => career_members.id)
# career_step_id (career_step_id => career_steps.id)
#
class Career::Step::Member < ApplicationRecord
include StateConcern
include Career::Step::MemberRepository
Expand Down
9 changes: 9 additions & 0 deletions app/models/country.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: countries
#
# id :integer not null, primary key
# name :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Country < ApplicationRecord
end
23 changes: 23 additions & 0 deletions app/models/event.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: events
#
# id :integer not null, primary key
# kind :string not null
# locale :string not null
# resource_type :string not null
# state :string not null
# created_at :datetime not null
# updated_at :datetime not null
# resource_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_events_on_resource (resource_type,resource_id)
# index_events_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Event < ApplicationRecord
extend Enumerize
include StateConcern
Expand Down
22 changes: 22 additions & 0 deletions app/models/notification.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: notifications
#
# id :integer not null, primary key
# kind :string
# resource_type :string not null
# state :string
# created_at :datetime not null
# updated_at :datetime not null
# resource_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_notifications_on_resource_type_and_resource_id (resource_type,resource_id)
# index_notifications_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Notification < ApplicationRecord
include AASM

Expand Down
39 changes: 39 additions & 0 deletions app/models/resume.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: resumes
#
# id :integer not null, primary key
# about_myself :text
# answers_count :integer default(0), not null
# awards_description :text
# city :string
# contact :string
# contact_email :string
# contact_phone :string
# contact_telegram :string
# english_fluency :string
# evaluated_ai :boolean
# evaluated_ai_state :string
# github_url :string
# hexlet_url :string
# impressions_count :integer default(0)
# locale :string
# name :string not null
# projects_description :text
# relocation :string
# skills_description :text
# state :string
# summary :text
# url :string
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer not null
#
# Indexes
#
# index_resumes_on_user_id (user_id)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Resume < ApplicationRecord
include StateConcern
extend Enumerize
Expand Down
24 changes: 24 additions & 0 deletions app/models/resume/answer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: resume_answers
#
# id :integer not null, primary key
# applying_state :string
# content :text
# likes_count :integer
# created_at :datetime not null
# updated_at :datetime not null
# resume_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_resume_answers_on_resume_id (resume_id)
# index_resume_answers_on_user_id (user_id)
# index_resume_answers_on_user_id_and_resume_id (user_id,resume_id) UNIQUE
#
# Foreign Keys
#
# resume_id (resume_id => resumes.id)
# user_id (user_id => users.id)
#
class Resume::Answer < ApplicationRecord
include AASM
include Resume::AnswerRepository
Expand Down
27 changes: 27 additions & 0 deletions app/models/resume/answer/comment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: resume_answer_comments
#
# id :integer not null, primary key
# content :string
# created_at :datetime not null
# updated_at :datetime not null
# answer_id :integer not null
# answer_user_id :integer not null
# resume_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_resume_answer_comments_on_answer_id (answer_id)
# index_resume_answer_comments_on_answer_user_id (answer_user_id)
# index_resume_answer_comments_on_resume_id (resume_id)
# index_resume_answer_comments_on_user_id (user_id)
#
# Foreign Keys
#
# answer_id (answer_id => resume_answers.id)
# answer_user_id (answer_user_id => users.id)
# resume_id (resume_id => resumes.id)
# user_id (user_id => users.id)
#
class Resume::Answer::Comment < ApplicationRecord
validates :content, presence: true, length: { minimum: 10, maximum: 400 }

Expand Down
24 changes: 24 additions & 0 deletions app/models/resume/answer/like.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# frozen_string_literal: true

# == Schema Information
#
# Table name: resume_answer_likes
#
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# answer_id :integer not null
# resume_id :integer not null
# user_id :integer not null
#
# Indexes
#
# index_resume_answer_likes_on_answer_id (answer_id)
# index_resume_answer_likes_on_answer_id_and_user_id (answer_id,user_id) UNIQUE
# index_resume_answer_likes_on_resume_id (resume_id)
# index_resume_answer_likes_on_user_id (user_id)
#
# Foreign Keys
#
# answer_id (answer_id => resume_answers.id)
# resume_id (resume_id => resumes.id)
# user_id (user_id => users.id)
#
class Resume::Answer::Like < ApplicationRecord
counter_culture %i[answer user], column_name: 'resume_answer_likes_count'

Expand Down
Loading

0 comments on commit cef8f47

Please sign in to comment.