bright 1.2.3 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b40a86733b8e9731616433228146a6c4c8f05ae6ea9a3e6c5674bc5e217bfa56
4
- data.tar.gz: a99d79f1a3d472e2c53cb2a6bdaf541d75f75435791d1af99b4b3a428278dc6b
3
+ metadata.gz: 6a3d3db120102506bfe30f6e5e301eb8baa8fd9365ba042698423ab3ccc536ae
4
+ data.tar.gz: cba89c2569e6a8b657009032026607efe0c4d634f20ec2835a13dada74898097
5
5
  SHA512:
6
- metadata.gz: c1e360e8df79dbfbeb06b2a3746a841932fd6e969739f4e4d76b50964952479fbf58833e26280cb230fb4f07c5d209272fdb62aab3bbe72c13f64caff71c3b6d
7
- data.tar.gz: 5a654e27949c09573c0024c543363c50e512249a6ea8078c14c8301fb9a426fe7639dd2f439aa75af36df8166f418b2308da68322382362bb32fe71f543630c5
6
+ metadata.gz: 1ee050314bef57a8a4d42a33096155cd3e3a6d0fd8acc080e7857f89b1c6f25ab5c3dad8ee297e08712a34a46d5056bb5ad8d6491a2d4d07befd8ba91cc669f2
7
+ data.tar.gz: 30125dbe150d94a911692d542881e6bb7be366260e2596b9ff602f55ce6541bf5a8d5a2df63d4c38fc96374dad0e4ad1a91b41458a656db7c8c84d64c2bcf3f6
@@ -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, :gender, :relationship_type,
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] = attrs["FirstName"]
106
- cattrs[:middle_name] = attrs["MiddleName"]
107
- cattrs[:last_name] = attrs["LastName"]
105
+ cattrs[:first_name] = attrs["FirstName"]
106
+ cattrs[:middle_name] = attrs["MiddleName"]
107
+ cattrs[:last_name] = attrs["LastName"]
108
108
 
109
- cattrs[:api_id] = attrs["PermanentID"]
110
- cattrs[:sis_student_id] = attrs["StudentNumber"]
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[:gender] = attrs["Sex"]
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
- :gender => student_params["gender"],
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[:gender] = demographics_params["sex"].to_s[0].upcase
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[:gender] = demographics_params["sex"].to_s[0].upcase
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
- cattrs[:gender] = attrs["demographics"]["gender"]
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
@@ -289,7 +290,8 @@ module Bright
289
290
  :last_name => student.last_name
290
291
  }.reject{|k,v| v.respond_to?(:empty?) ? v.empty? : v.nil?},
291
292
  :demographics => {
292
- :gender => student.gender.to_s[0].to_s.upcase,
293
+ # To avoid a mismatch of attributes, we'll ignore for now
294
+ # :gender => student.gender.to_s[0].to_s.upcase,
293
295
  :birth_date => (student.birth_date ? student.birth_date.strftime(DATE_FORMAT) : nil),
294
296
  :projected_graduation_year => student.projected_graduation_year
295
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
- :gender => user_params["Gender"],
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?}
@@ -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, :gender,
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]
@@ -1,3 +1,3 @@
1
1
  module Bright
2
- VERSION = "1.2.3"
2
+ VERSION = "1.3"
3
3
  end
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.2.3
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: 2024-06-11 00:00:00.000000000 Z
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.7
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