@@ -178,7 +178,9 @@ def airtable_twin
178
178
end
179
179
end
180
180
181
- def sync_with_airtable ( airtable_user , airtable_table )
181
+ def sync_with_airtable ( airtable_user
182
+ # , airtable_table
183
+ )
182
184
self . skip_push_to_airtable = true
183
185
184
186
if self . new_record?
@@ -230,41 +232,43 @@ def sync_with_airtable(airtable_user, airtable_table)
230
232
self . get_slack_username
231
233
end
232
234
233
- elsif airtable_table == "admin"
234
- self . assign_attributes ( {
235
- name : airtable_user [ "Name" ] ,
236
- read_code_of_conduct : airtable_user [ "Read Code of Conduct" ] ,
237
- anonymous : airtable_user [ "I prefer to remain anonymous." ] ,
238
- welcome_email_sent : airtable_user [ "Welcome E-mail Sent" ] ,
239
- attended_onboarding : airtable_user [ "Attended Onboarding" ] ,
240
- slack_invite_sent : airtable_user [ "Slack invite sent?" ] ,
241
- requested_additional_verification : airtable_user [ "Requested additional verification" ] ,
242
- decline_membership : airtable_user [ "Declime Membership" ] ,
243
- irs_email_sent : airtable_user [ "IRS Email Sent" ] ,
244
- internal_notes : airtable_user [ "Internal Notes" ] ,
245
- contributor : airtable_user [ "Contributor?" ] ,
246
- email : airtable_user [ "Contact E-Mail" ] ,
247
- verification_urls : airtable_user [ "Verification URLs" ] ,
248
- hear_about_us : airtable_user [ "How did you hear about us?" ] ,
249
- referrer_name : airtable_user [ "Name of ProgCode member who referred you." ] ,
250
- skills_and_experience : airtable_user [ "Skills and Relevant Experience (Tech or Non-Tech)" ] ,
251
- join_reason : airtable_user [ "Bio" ] ,
252
- phone : airtable_user [ "Phone" ] ,
253
- optin : airtable_user [ "Opt In to Anonymized Member Directory" ] ,
254
- location : airtable_user [ "Location" ] ,
255
- read_manifesto : airtable_user [ "Read Manifesto" ]
256
- } )
257
-
258
- if self . decline_membership
259
- self . is_approved = false
260
- elsif self . welcome_email_sent
261
- self . is_approved = true
262
- end
235
+ # elsif airtable_table == "admin"
236
+ # self.assign_attributes({
237
+ # name: airtable_user["Name"],
238
+ # read_code_of_conduct: airtable_user["Read Code of Conduct"],
239
+ # anonymous: airtable_user["I prefer to remain anonymous."],
240
+ # welcome_email_sent: airtable_user["Welcome E-mail Sent"],
241
+ # attended_onboarding: airtable_user["Attended Onboarding"],
242
+ # slack_invite_sent: airtable_user["Slack invite sent?"],
243
+ # requested_additional_verification: airtable_user["Requested additional verification"],
244
+ # decline_membership: airtable_user["Declime Membership"],
245
+ # irs_email_sent: airtable_user["IRS Email Sent"],
246
+ # internal_notes: airtable_user["Internal Notes"],
247
+ # contributor: airtable_user["Contributor?"],
248
+ # email: airtable_user["Contact E-Mail"],
249
+ # verification_urls: airtable_user["Verification URLs"],
250
+ # hear_about_us: airtable_user["How did you hear about us?"],
251
+ # referrer_name: airtable_user["Name of ProgCode member who referred you."],
252
+ # skills_and_experience: airtable_user["Skills and Relevant Experience (Tech or Non-Tech)"],
253
+ # join_reason: airtable_user["Bio"],
254
+ # phone: airtable_user["Phone"],
255
+ # optin: airtable_user["Opt In to Anonymized Member Directory"],
256
+ # location: airtable_user["Location"],
257
+ # read_manifesto: airtable_user["Read Manifesto"]
258
+ # })
259
+
260
+ # if self.decline_membership
261
+ # self.is_approved = false
262
+ # elsif self.welcome_email_sent
263
+ # self.is_approved = true
264
+ # end
263
265
264
- end
266
+ # end
265
267
266
268
if self . email . present? || self . slack_userid . present?
267
- all_airtable_users = airtable_table == 'admin' ? AirtableUserFromAdmin . all : AirtableUser . all
269
+ all_airtable_users = AirtableUser . all
270
+ # airtable_table == 'admin' ? AirtableUserFromAdmin.all :
271
+
268
272
matches = all_airtable_users . select { |u | ( self . email . present? && u [ "Contact E-Mail" ] == self . email ) || ( self . slack_userid . present? && u [ "slack_id" ] == self . slack_userid ) }
269
273
if matches . length > 1
270
274
self . flags << "This user appears more than once in Airtable"
0 commit comments