Skip to content

Commit

Permalink
[core] validation and ransack attributes
Browse files Browse the repository at this point in the history
fix email

update license
  • Loading branch information
tapalilov authored and Kagetsuki committed Feb 17, 2018
1 parent 65ab25f commit 64bbb32
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,4 +1,4 @@
GAKU Engine is Copyright 2012 K.K. GenSouSha of Aichi, Japan
GAKU Engine Copyright 2012 K.K. GenSouSha of Aichi, Japan
All rights reserved.

This software is dual licensed under the GNU GPL version 3 and the AGPL version 3.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -16,8 +16,8 @@ We do not currently recommend anyone use it in a production environment.

License
-------
This software is dual licensed under the GNU GPL version 3 and the AGPL version 3.
Separate licenses are available upon consultation. Please contact info@genshin.org for details.
This software is dual licensed under the GNU GPL version 3 and the AGPL version 3.
Separate licenses are available upon consultation. Please contact info@gakuengine.com for details.

What does it do?
----------------
Expand Down
4 changes: 4 additions & 0 deletions core/app/models/gaku/student.rb
Expand Up @@ -50,6 +50,10 @@ class Student < ApplicationRecord
after_create :set_serial_id
after_save :set_code

def self.ransackable_attributes(auth_object = nil)
super & %w(enrollment_status_code)
end

def full_name
"#{surname} #{name}"
end
Expand Down
2 changes: 2 additions & 0 deletions core/app/models/gaku/student_guardian.rb
Expand Up @@ -2,5 +2,7 @@ module Gaku
class StudentGuardian < ActiveRecord::Base
belongs_to :student, counter_cache: :guardians_count
belongs_to :guardian

validates :student_id, uniqueness: { scope: :guardian_id }
end
end

0 comments on commit 64bbb32

Please sign in to comment.