next_sges 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f76ef9e87db3d81905ab791e4bca8b56ebb5dd63
4
- data.tar.gz: 0d12af3d531db1444101ffc945cd16f8951eac87
3
+ metadata.gz: 4e1e2fe476e2ed414447d2286d54973b0d7c003b
4
+ data.tar.gz: c4276ba6b82c64ae53846c956d832d53f333290e
5
5
  SHA512:
6
- metadata.gz: 017c73a922067cff90ef9bc92a45ebcccaf16cb9b01ae970831c49a78e2699e31cd0014d5156ec28ddaa610d81d0e2f7e6b91befaaa53ce057af633af58c7086
7
- data.tar.gz: 4ac56e9fea706fe7fb5b2746f4a522cc4104736fb092f6855dd64496c72d080ead94ebd63ac9eb939bf48d2ee44c3bf8cac4e034def62cb772af569d9cb1f415
6
+ metadata.gz: 9096ebdb1db942dffd62a05fa213908103d531bad8f2cc6aef88ca59240cb312a56deae35146ffd875ec966a89c85871734c626c2b670bcb3dbd121f7d6104cf
7
+ data.tar.gz: e7a319c7e438ad373ccfe3ee0afa84179ae0ff525c992fd47ed0177e12fe369f524eab70b92be890e04fca6dd7a9e9d5114222a46ebec4c9ad9850eee77eff9b
@@ -12,11 +12,17 @@ module NextSges
12
12
  has_many :student_responsible_periods, through: :student_responsibles, class_name: StudentResponsiblePeriod.name
13
13
  has_many :bank_accounts, as: :owner
14
14
 
15
- has_many :other_services, dependent: :destroy, class_name: OtherService.name
16
15
  has_many :cycles, dependent: :destroy, class_name: Cycle.name
17
16
  has_many :class_rooms, dependent: :destroy, class_name: ClassRoom.name
18
17
  has_many :student_class_rooms, through: :class_rooms, class_name: StudentClassRoom.name
19
18
 
19
+ has_many :collaborator_schools, dependent: :destroy, class_name: CollaboratorSchool.name
20
+ has_many :collaborators, through: :collaborator_schools, class_name: Collaborator.name
21
+ has_many :collaborator_class_rooms, dependent: :destroy, class_name: CollaboratorClassRoom.name
22
+
23
+
24
+ # has_and_belongs_to_many :collaborators, association_foreign_key: :collaborator_id, foreign_key: :next_sges_school_id
25
+
20
26
 
21
27
 
22
28
  INITIAL_LETTER = "C"
@@ -12,13 +12,25 @@ module NextSges
12
12
  has_many :responsibles, through: :student_responsibles, class_name: Responsible.name
13
13
  has_many :student_responsible_periods, through: :student_responsibles, class_name: StudentResponsiblePeriod.name
14
14
  has_and_belongs_to_many :collection_types, association_foreign_key: :next_sges_collection_type_id, foreign_key: :next_sges_student_id
15
+
15
16
  enum relation: {son: 0, other: 1}
16
17
  enum identification_type: {identification_card: 0, identification: 1, passport: 2}
17
18
  enum gender: {male: 0, female: 1}
19
+ enum status: {active: 0, inactive: 1}
20
+
18
21
  scope :student_name, -> (data) {data.present? ? where(id: [data].flatten.compact.uniq.map{|f| f.split(',,,')}.flatten.uniq) : all}
19
22
  scope :student_number, -> (data) {data.present? ? where(number: [data].flatten.compact.uniq.map{|f| f.split(',,,')}.flatten.uniq) : all}
20
23
 
24
+ scope :student_cycle, -> (data) {data.present? ? where(id: Cycle.find_by(id: [data].flatten.compact.uniq.map{|f| f.split(',,,')}.flatten.uniq).students.ids) : all}
25
+ scope :student_class_room_id, -> (data) {data.present? ? where(id: [data].flatten.compact.uniq.map{|f| f.split(',,,')}.flatten.uniq) : all}
26
+ scope :student_status, -> (data){data.present? ? where(status: data) : all}
27
+
28
+
29
+
21
30
 
31
+ # def self.student_cycle(l)
32
+ # # where('extract(year from updated_at) = ?', DateTime.now.year)
33
+ # end
22
34
 
23
35
  attr_accessor :aux_types_ids
24
36
  INITIAL_LETTER = "A"
@@ -1,3 +1,3 @@
1
1
  module NextSges
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: next_sges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - NEXTBSS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-22 00:00:00.000000000 Z
11
+ date: 2018-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails