Skip to content

Commit

Permalink
Merge pull request #902 from PlanoramaEvents/erys/annotate
Browse files Browse the repository at this point in the history
Add annotate gem
  • Loading branch information
balen authored Nov 26, 2023
2 parents 25c3dfb + bf2e489 commit 9b06cac
Show file tree
Hide file tree
Showing 155 changed files with 3,084 additions and 40 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ group :development do
gem 'guard'
gem 'guard-livereload'
gem 'rack-livereload'
gem 'annotate'
end

group :test do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ GEM
activerecord (>= 6.0, < 7.1)
addressable (2.8.5)
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)
base64 (0.1.1)
bcrypt (3.1.19)
Expand Down Expand Up @@ -483,6 +486,7 @@ DEPENDENCIES
active_model_serializers (~> 0.10.0)
activerecord-postgres_enum
acts-as-taggable-on (~> 9.0)
annotate
bootsnap (>= 1.4.4)
brakeman
bundler-audit
Expand Down
1 change: 1 addition & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ tasks:
deps:
- task: quickstart
vars: { CLI_ARGS: 'postgres' }
- task: build
cmds:
- docker-compose -f docker-compose-dev.yml run --rm --no-deps planorama bin/rails db:migrate {{.CLI_ARGS}}
psql:
Expand Down
10 changes: 10 additions & 0 deletions app/models/age_restriction.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# == Schema Information
#
# Table name: age_restrictions
#
# id :uuid not null, primary key
# lock_version :integer
# name :string(500)
# created_at :datetime not null
# updated_at :datetime not null
#
class AgeRestriction < ApplicationRecord
validates :name, presence: true

Expand Down
22 changes: 22 additions & 0 deletions app/models/agreement.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# == Schema Information
#
# Table name: agreements
#
# id :uuid not null, primary key
# agreement_type :string
# description :string(10000)
# lock_version :integer default(0)
# target :enum
# terms :text
# title :string
# created_at :datetime not null
# updated_at :datetime not null
# created_by_id :uuid not null
# updated_by_id :uuid not null
#
# Indexes
#
# index_agreements_on_created_by_id (created_by_id)
# index_agreements_on_target (target)
# index_agreements_on_updated_by_id (updated_by_id)
#
class Agreement < ApplicationRecord
enum target: { none: 'none', participant: 'participant', staff: 'staff', all: 'all' }, _suffix: true

Expand Down
16 changes: 16 additions & 0 deletions app/models/application_role.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# == Schema Information
#
# Table name: application_roles
#
# id :uuid not null, primary key
# con_roles :text default([]), is an Array
# lock_version :integer default(0)
# name :string not null
# sensitive_access :boolean default(FALSE)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_application_roles_on_con_roles (con_roles) USING gin
#
#
class ApplicationRole < ApplicationRecord
has_many :model_permissions, dependent: :destroy
Expand Down
15 changes: 15 additions & 0 deletions app/models/area.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# == Schema Information
#
# Table name: areas
#
# id :uuid not null, primary key
# lock_version :integer default(0)
# name :string
# sort_order :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_areas_on_name (name) UNIQUE
#
class Area < ApplicationRecord
include RankedModel
ranks :sort_order
Expand Down
17 changes: 17 additions & 0 deletions app/models/audit/person_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: audit_people_versions
#
# id :bigint not null, primary key
# event :string not null
# item_type :string not null
# object :json
# object_changes :json
# whodunnit :string
# created_at :datetime
# item_id :uuid not null
#
# Indexes
#
# index_audit_people_versions_on_item_type_and_item_id (item_type,item_id)
#
module Audit
class PersonVersion < PaperTrail::Version
self.table_name = :audit_people_versions
Expand Down
17 changes: 17 additions & 0 deletions app/models/audit/published_session_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: audit_published_session_versions
#
# id :bigint not null, primary key
# event :string not null
# item_type :string not null
# object :json
# object_changes :json
# whodunnit :string
# created_at :datetime
# item_id :uuid not null
#
# Indexes
#
# index_audit_published_session_versions_on_item_type_and_item_id (item_type,item_id)
#
module Audit
class PublishedSessionVersion < PaperTrail::Version
self.table_name = :audit_published_session_versions
Expand Down
17 changes: 17 additions & 0 deletions app/models/audit/session_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: audit_session_versions
#
# id :bigint not null, primary key
# event :string not null
# item_type :string not null
# object :json
# object_changes :json
# whodunnit :string
# created_at :datetime
# item_id :uuid not null
#
# Indexes
#
# index_audit_session_versions_on_item_type_and_item_id (item_type,item_id)
#
module Audit
class SessionVersion < PaperTrail::Version
self.table_name = :audit_session_versions
Expand Down
17 changes: 17 additions & 0 deletions app/models/audit/survey_version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: audit_survey_versions
#
# id :bigint not null, primary key
# event :string not null
# item_type :string not null
# object :json
# object_changes :json
# whodunnit :string
# created_at :datetime
# item_id :uuid not null
#
# Indexes
#
# index_audit_survey_versions_on_item_type_and_item_id (item_type,item_id)
#
module Audit
class SurveyVersion < PaperTrail::Version
self.table_name = :audit_survey_versions
Expand Down
12 changes: 12 additions & 0 deletions app/models/availability.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: availabilities
#
# id :uuid not null, primary key
# end_time :datetime
# lock_version :integer
# start_time :datetime
# created_at :datetime not null
# updated_at :datetime not null
# person_id :uuid
#
class Availability < ApplicationRecord
belongs_to :person
validates :person_id, presence: true
Expand Down
19 changes: 19 additions & 0 deletions app/models/category.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# == Schema Information
#
# Table name: categories
#
# id :uuid not null, primary key
# active :boolean default(TRUE), not null
# description :string
# name :string(191) not null
# reserved :boolean default(FALSE), not null
# target_class :string(100)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# by_active_status (active)
# by_name_and_target_class (name,target_class) UNIQUE
# by_reserved_status (reserved)
#
class Category < ApplicationRecord
belongs_to :category_name
belongs_to :categorized, polymorphic: true
Expand Down
20 changes: 20 additions & 0 deletions app/models/configuration.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: configurations
#
# id :uuid not null, primary key
# lock_version :integer default(0)
# parameter :string(45) not null
# parameter_value :string(150) not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# fk_configurations_parameters_idx (parameter)
# fl_configurations_unique_index (parameter) UNIQUE
#
# Foreign Keys
#
# fk_configurations_parameters (parameter => parameter_names.parameter_name)
#
class Configuration < ApplicationRecord
belongs_to :parameter_name, foreign_key: 'parameter', inverse_of: :configuration
end
16 changes: 15 additions & 1 deletion app/models/conflict_exception.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# require 'planner_utils'
# == Schema Information
#
# Table name: conflict_exceptions
#
# id :uuid not null, primary key
# affected :integer
# conflict_type :string
# idx :bigint
# lock_version :integer default(0)
# note :text
# src1 :integer
# src2 :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class ConflictException < ApplicationRecord
validates_inclusion_of :conflict_type,
in: %i[schedule room item avail time back2back]
Expand Down
18 changes: 18 additions & 0 deletions app/models/conflicts/availability_conflict.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# == Schema Information
#
# Table name: availability_conflicts
#
# id :text primary key
# person_name :string
# person_published_name :string
# session_assignment_name :string(100)
# session_assignment_role_type :enum
# session_duration :integer
# session_start_time :datetime
# session_title :string(256)
# person_id :uuid
# session_assignment_id :uuid
# session_assignment_role_type_id :uuid
# session_id :uuid
# session_room_id :uuid
#
class Conflicts::AvailabilityConflict < ApplicationRecord
self.table_name = :availability_conflicts
self.primary_key = :id
Expand Down
29 changes: 29 additions & 0 deletions app/models/conflicts/person_back_to_back.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# == Schema Information
#
# Table name: person_back_to_back
#
# id :text primary key
# con_state :enum
# conflict_duration :integer
# conflict_end_time :datetime
# conflict_session_assignment_name :string(100)
# conflict_session_assignment_role_type :enum
# conflict_session_title :string(256)
# conflict_start_time :datetime
# duration :integer
# end_time :datetime
# name :string
# published_name :string
# session_assignment_name :string(100)
# session_assignment_role_type :enum
# start_time :datetime
# title :string(256)
# conflict_room_id :uuid
# conflict_session_assignment_role_type_id :uuid
# conflict_session_id :uuid
# person_id :uuid
# room_id :uuid
# session_assignment_id :uuid
# session_assignment_role_type_id :uuid
# session_id :uuid
#
class Conflicts::PersonBackToBack < ApplicationRecord
self.table_name = :person_back_to_back
self.primary_key = :id
Expand Down
41 changes: 41 additions & 0 deletions app/models/conflicts/person_back_to_back_to_back.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# == Schema Information
#
# Table name: person_back_to_back_to_back
#
# id :text primary key
# con_state :enum
# conflict_duration :integer
# conflict_end_time :datetime
# conflict_session_assignment_name :string(100)
# conflict_session_assignment_role_type :enum
# conflict_session_title :string(256)
# conflict_start_time :datetime
# duration :integer
# end_time :datetime
# middle_duration :integer
# middle_end_time :datetime
# middle_session_assignment_name :string(100)
# middle_session_assignment_role_type :enum
# middle_start_time :datetime
# middle_title :string(256)
# name :string
# published_name :string
# session_assignment_name :string(100)
# session_assignment_role_type :enum
# start_time :datetime
# title :string(256)
# b2b_id :text
# conflict_b2b_id :text
# conflict_room_id :uuid
# conflict_session_assignment_role_type_id :uuid
# conflict_session_id :uuid
# middle_room_id :uuid
# middle_session_assignment_id :uuid
# middle_session_assignment_role_type_id :uuid
# middle_session_id :uuid
# person_id :uuid
# room_id :uuid
# session_assignment_id :uuid
# session_assignment_role_type_id :uuid
# session_id :uuid
#
class Conflicts::PersonBackToBackToBack < ApplicationRecord
self.table_name = :person_back_to_back_to_back
self.primary_key = :id
Expand Down
Loading

0 comments on commit 9b06cac

Please sign in to comment.