bright 1.2.2 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bright/contact.rb +1 -1
- data/lib/bright/sis_apis/aeries.rb +7 -7
- data/lib/bright/sis_apis/bright_sis.rb +1 -1
- data/lib/bright/sis_apis/focus.rb +1 -1
- data/lib/bright/sis_apis/infinite_campus.rb +1 -1
- data/lib/bright/sis_apis/power_school.rb +8 -3
- data/lib/bright/sis_apis/skyward.rb +2 -1
- data/lib/bright/student.rb +1 -1
- data/lib/bright/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a3d3db120102506bfe30f6e5e301eb8baa8fd9365ba042698423ab3ccc536ae
|
4
|
+
data.tar.gz: cba89c2569e6a8b657009032026607efe0c4d634f20ec2835a13dada74898097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ee050314bef57a8a4d42a33096155cd3e3a6d0fd8acc080e7857f89b1c6f25ab5c3dad8ee297e08712a34a46d5056bb5ad8d6491a2d4d07befd8ba91cc669f2
|
7
|
+
data.tar.gz: 30125dbe150d94a911692d542881e6bb7be366260e2596b9ff602f55ce6541bf5a8d5a2df63d4c38fc96374dad0e4ad1a91b41458a656db7c8c84d64c2bcf3f6
|
data/lib/bright/contact.rb
CHANGED
@@ -3,7 +3,7 @@ require 'securerandom'
|
|
3
3
|
module Bright
|
4
4
|
class Contact < Model
|
5
5
|
@attribute_names = [:client_id, :api_id, :first_name, :middle_name, :last_name, :nick_name,
|
6
|
-
:birth_date, :
|
6
|
+
:birth_date, :sex, :relationship_type,
|
7
7
|
:hispanic_ethnicity, :race, :image,
|
8
8
|
:sis_student_id, :state_student_id, :last_modified]
|
9
9
|
attr_accessor *@attribute_names
|
@@ -77,7 +77,7 @@ module Bright
|
|
77
77
|
else
|
78
78
|
body = JSON.dump(params)
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
response = connection_retry_wrapper {
|
82
82
|
connection = Bright::Connection.new(uri)
|
83
83
|
headers = self.headers_for_auth
|
@@ -102,15 +102,15 @@ module Bright
|
|
102
102
|
def convert_to_student_data(attrs)
|
103
103
|
cattrs = {}
|
104
104
|
|
105
|
-
cattrs[:first_name]
|
106
|
-
cattrs[:middle_name]
|
107
|
-
cattrs[:last_name]
|
105
|
+
cattrs[:first_name] = attrs["FirstName"]
|
106
|
+
cattrs[:middle_name] = attrs["MiddleName"]
|
107
|
+
cattrs[:last_name] = attrs["LastName"]
|
108
108
|
|
109
|
-
cattrs[:api_id]
|
110
|
-
cattrs[:sis_student_id]
|
109
|
+
cattrs[:api_id] = attrs["PermanentID"]
|
110
|
+
cattrs[:sis_student_id] = attrs["StudentNumber"]
|
111
111
|
cattrs[:state_student_id] = attrs["StateStudentID"]
|
112
112
|
|
113
|
-
cattrs[:
|
113
|
+
cattrs[:sex] = attrs["Sex"]
|
114
114
|
if attrs["Birthdate"]
|
115
115
|
begin
|
116
116
|
cattrs[:birth_date] = Date.strptime(attrs["Birthdate"], DATE_FORMAT)
|
@@ -162,7 +162,7 @@ module Bright
|
|
162
162
|
:grade => student_params["grade"],
|
163
163
|
:grade_school_year => student_params["grade_school_year"],
|
164
164
|
:projected_graduation_year => student_params["graduation_year"],
|
165
|
-
:
|
165
|
+
:sex => student_params["sex"],
|
166
166
|
:frl_status => student_params["frl_status"],
|
167
167
|
:image => student_params["picture"],
|
168
168
|
:hispanic_ethnicity => student_params["hispanic_latino"],
|
@@ -346,7 +346,7 @@ module Bright
|
|
346
346
|
demographic_hsh[:birth_date] = Date.parse(bday).to_s
|
347
347
|
end
|
348
348
|
unless demographics_params["sex"].to_s[0].blank?
|
349
|
-
demographic_hsh[:
|
349
|
+
demographic_hsh[:sex] = demographics_params["sex"].to_s[0].upcase
|
350
350
|
end
|
351
351
|
DEMOGRAPHICS_CONVERSION.each do |demographics_key, demographics_value|
|
352
352
|
if demographics_params[demographics_key].to_bool
|
@@ -356,7 +356,7 @@ module Bright
|
|
356
356
|
demographic_hsh[:birth_date] = Date.parse(bday).to_s
|
357
357
|
end
|
358
358
|
unless demographics_params["sex"].to_s[0].blank?
|
359
|
-
demographic_hsh[:
|
359
|
+
demographic_hsh[:sex] = demographics_params["sex"].to_s[0].upcase
|
360
360
|
end
|
361
361
|
DEMOGRAPHICS_CONVERSION.each do |demographics_key, demographics_value|
|
362
362
|
if demographics_params[demographics_key].to_bool
|
@@ -227,7 +227,8 @@ module Bright
|
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
|
-
|
230
|
+
# To avoid a mismatch of attributes, we'll ignore for now
|
231
|
+
# cattrs[:gender] = attrs["demographics"]["gender"]
|
231
232
|
|
232
233
|
pg = attrs["demographics"]["projected_graduation_year"].to_i
|
233
234
|
cattrs[:projected_graduation_year] = pg if pg > 0
|
@@ -247,7 +248,10 @@ module Bright
|
|
247
248
|
end
|
248
249
|
|
249
250
|
if !attrs.dig("ethnicity_race", "federal_ethnicity").nil?
|
250
|
-
|
251
|
+
begin
|
252
|
+
cattrs[:hispanic_ethnicity] = attrs.dig("ethnicity_race", "federal_ethnicity").to_bool
|
253
|
+
rescue
|
254
|
+
end
|
251
255
|
end
|
252
256
|
end
|
253
257
|
|
@@ -286,7 +290,8 @@ module Bright
|
|
286
290
|
:last_name => student.last_name
|
287
291
|
}.reject{|k,v| v.respond_to?(:empty?) ? v.empty? : v.nil?},
|
288
292
|
:demographics => {
|
289
|
-
|
293
|
+
# To avoid a mismatch of attributes, we'll ignore for now
|
294
|
+
# :gender => student.gender.to_s[0].to_s.upcase,
|
290
295
|
:birth_date => (student.birth_date ? student.birth_date.strftime(DATE_FORMAT) : nil),
|
291
296
|
:projected_graduation_year => student.projected_graduation_year
|
292
297
|
}.reject{|k,v| v.respond_to?(:empty?) ? v.empty? : v.nil?}
|
@@ -168,7 +168,8 @@ module Bright
|
|
168
168
|
:sis_student_id => user_params["DisplayId"],
|
169
169
|
:state_student_id => user_params["StateId"],
|
170
170
|
:projected_graduation_year => user_params["GradYr"],
|
171
|
-
|
171
|
+
# To avoid a mismatch of attributes, we'll ignore for now
|
172
|
+
# :gender => user_params["Gender"],
|
172
173
|
:hispanic_ethnicity => user_params["HispanicLatinoEthnicity"],
|
173
174
|
:relationship_type => user_params["RelationshipType"]
|
174
175
|
}.reject{|k,v| v.blank?}
|
data/lib/bright/student.rb
CHANGED
@@ -3,7 +3,7 @@ require 'securerandom'
|
|
3
3
|
module Bright
|
4
4
|
class Student < Model
|
5
5
|
@attribute_names = [:client_id, :api_id, :first_name, :middle_name, :last_name, :nick_name,
|
6
|
-
:birth_date, :grade, :grade_school_year, :projected_graduation_year, :
|
6
|
+
:birth_date, :grade, :grade_school_year, :projected_graduation_year, :sex,
|
7
7
|
:hispanic_ethnicity, :race, :image, :primary_language, :secondary_language,
|
8
8
|
:homeless_code, :frl_status, :sis_student_id,
|
9
9
|
:state_student_id, :last_modified]
|
data/lib/bright/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bright
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arux Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpi
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
|
-
rubygems_version: 3.3
|
158
|
+
rubygems_version: 3.2.3
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: Framework and tools for dealing with Student Information Systems
|