diff --git a/.codebeatsettings b/.codebeatsettings deleted file mode 100644 index 7ff72a765..000000000 --- a/.codebeatsettings +++ /dev/null @@ -1,5 +0,0 @@ -{ - "RUBY": { - "ABC": [15, 25, 50, 70] - } -} \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index d37f54432..51781aa6f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,7 +51,7 @@ GEM arel (9.0.0) ast (2.4.0) aws-eventstream (1.0.1) - aws-partitions (1.111.0) + aws-partitions (1.113.0) aws-sdk-core (3.38.0) aws-eventstream (~> 1.0) aws-partitions (~> 1.0) @@ -78,7 +78,7 @@ GEM bundler (~> 1.2) thor (~> 0.18) byebug (10.0.2) - capybara (3.10.1) + capybara (3.11.0) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) @@ -223,7 +223,7 @@ GEM rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) redis (4.0.3) - regexp_parser (1.2.0) + regexp_parser (1.3.0) responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) diff --git a/README.md b/README.md index cc84b7e8d..6ac8f534b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Nokul -[![Beta](https://omu.sh/assets/badge/beta.svg)](https://omu.sh "BAUM Beta") [![CircleCI](https://circleci.com/gh/omu/nokul/tree/master.svg?style=svg&circle-token=a25e63abc0e1e6c074750d9b2ce5396e3e279d82)](https://circleci.com/gh/omu/nokul/tree/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/06aecaa466ee4731aba08dbee43d74eb)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=omu/nokul&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/06aecaa466ee4731aba08dbee43d74eb)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=omu/nokul&utm_campaign=Badge_Coverage) +[![Beta](https://omu.sh/assets/badge/beta.svg)](https://omu.sh "BAUM Beta") +[![CircleCI](https://circleci.com/gh/omu/nokul/tree/master.svg?style=svg&circle-token=a25e63abc0e1e6c074750d9b2ce5396e3e279d82)](https://circleci.com/gh/omu/nokul/tree/master) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/06aecaa466ee4731aba08dbee43d74eb)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=omu/nokul&utm_campaign=Badge_Grade) +[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/06aecaa466ee4731aba08dbee43d74eb)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=omu/nokul&utm_campaign=Badge_Coverage) +[![security](https://hakiri.io/projects/cf546402fb7117/stacks/622121c74c17f4/622121c74c17f4.svg?repo_token=xo-yGdqDKXvCf-jypXd-)](https://hakiri.io/projects/cf546402fb7117/stacks/622121c74c17f4/shield) [Nokul](https://github.com/omu/nokul) aims to become a complete solution for universities that face many challanges while trying to manage all the complex procedures of a university online. diff --git a/app/models/available_course.rb b/app/models/available_course.rb index 7ba166cb9..5f0a30555 100644 --- a/app/models/available_course.rb +++ b/app/models/available_course.rb @@ -6,4 +6,7 @@ class AvailableCourse < ApplicationRecord belongs_to :curriculum belongs_to :course has_many :groups, class_name: 'AvailableCourseGroup', dependent: :destroy + + # validations + validates :course, uniqueness: { scope: %i[academic_term curriculum] } end diff --git a/app/models/available_course_lecturer.rb b/app/models/available_course_lecturer.rb index aa89450f9..400bde9f7 100644 --- a/app/models/available_course_lecturer.rb +++ b/app/models/available_course_lecturer.rb @@ -6,7 +6,8 @@ class AvailableCourseLecturer < ApplicationRecord belongs_to :lecturer, class_name: 'Employee' # validations - validates :coordinator, presence: true, inclusion: { in: [true, false] } + validates :coordinator, inclusion: { in: [true, false] } + validates :lecturer, uniqueness: { scope: :group } # scopes scope :coordinator, -> { where(coordinator: true) } diff --git a/app/views/account/duties/_form.html.erb b/app/views/account/duties/_form.html.erb index c1aec9650..23fe3d6af 100644 --- a/app/views/account/duties/_form.html.erb +++ b/app/views/account/duties/_form.html.erb @@ -40,3 +40,5 @@ + +<%= render 'select2' %> \ No newline at end of file diff --git a/app/views/account/duties/_select2.html.erb b/app/views/account/duties/_select2.html.erb new file mode 100644 index 000000000..4f824f8be --- /dev/null +++ b/app/views/account/duties/_select2.html.erb @@ -0,0 +1,5 @@ + diff --git a/app/views/account/employees/_form.html.erb b/app/views/account/employees/_form.html.erb index 2e7261bd9..144871bfe 100644 --- a/app/views/account/employees/_form.html.erb +++ b/app/views/account/employees/_form.html.erb @@ -29,3 +29,5 @@ + +<%= render 'select2' %> \ No newline at end of file diff --git a/app/views/account/employees/_select2.html.erb b/app/views/account/employees/_select2.html.erb new file mode 100644 index 000000000..4651f7513 --- /dev/null +++ b/app/views/account/employees/_select2.html.erb @@ -0,0 +1,5 @@ + diff --git a/app/views/account/positions/_form.html.erb b/app/views/account/positions/_form.html.erb index f695b2e3d..274d18290 100644 --- a/app/views/account/positions/_form.html.erb +++ b/app/views/account/positions/_form.html.erb @@ -34,3 +34,5 @@ + +<%= render 'select2' %> \ No newline at end of file diff --git a/app/views/account/positions/_select2.html.erb b/app/views/account/positions/_select2.html.erb new file mode 100644 index 000000000..a177f8e31 --- /dev/null +++ b/app/views/account/positions/_select2.html.erb @@ -0,0 +1,5 @@ + diff --git a/app/views/calendar/academic_calendars/_calendar_event_fields.erb b/app/views/calendar/academic_calendars/_calendar_event_fields.erb index 578cf232e..d297e3fba 100644 --- a/app/views/calendar/academic_calendars/_calendar_event_fields.erb +++ b/app/views/calendar/academic_calendars/_calendar_event_fields.erb @@ -1,7 +1,7 @@
<%= t('.name') %> | +<%= t('activerecord.attributes.country.name') %> | <%= @country.name %> |