@@ -36,6 +36,7 @@ namespace :team do
36
36
ap ex . backtrace
37
37
puts
38
38
puts '*' *80
39
+
39
40
require 'pry' ; binding . pry
40
41
end
41
42
@@ -48,7 +49,10 @@ namespace :team do
48
49
# Ignoring:
49
50
# - updated_at
50
51
51
- # Team
52
+ puts '----------------------------------------------------------------------------------------------------'
53
+ puts 'TEAM'
54
+ puts '----------------------------------------------------------------------------------------------------'
55
+
52
56
%i( median score total slug mean pending_join_requests ) . each do |attr |
53
57
neq ( attr , pg_team , mongo_team , false )
54
58
end
@@ -78,15 +82,79 @@ namespace :team do
78
82
end
79
83
end
80
84
81
- # TODO: Locations
82
85
83
- # TODO: Links
86
+ puts '----------------------------------------------------------------------------------------------------'
87
+ puts 'LOCATIONS'
88
+ puts '----------------------------------------------------------------------------------------------------'
89
+
90
+ pg_team_locations = pg_team . locations
91
+ mongo_team_locations = mongo_team . team_locations
92
+
93
+ if mongo_team_locations . count != pg_team_locations . count
94
+ puts "locations | pg:#{ pg_team . id } | mongo:#{ mongo_team . id } | #{ mongo_team_locations . count } != #{ pg_team_locations . count } "
95
+ end
96
+
97
+ # Ignoring:
98
+ # - points_of_interest
99
+ pg_team . locations . each do |pg_team_location |
100
+ mongo_team_location = mongo_team . team_locations . select { |tl | tl . name == pg_team_location . name } . first
101
+
102
+ %i( address city country description name state_code ) . each do |attr |
103
+ neq ( attr , pg_team_location , mongo_team_location , false )
104
+ end
105
+ end
106
+
107
+
108
+ puts '----------------------------------------------------------------------------------------------------'
109
+ puts 'LINKS'
110
+ puts '----------------------------------------------------------------------------------------------------'
111
+
112
+ pg_team_links = pg_team . links
113
+ mongo_team_links = mongo_team . featured_links
114
+
115
+ if mongo_team_links . count != pg_team_links . count
116
+ puts "links | pg:#{ pg_team . id } | mongo:#{ mongo_team . id } | #{ mongo_team_links . count } != #{ pg_team_links . count } "
117
+ end
118
+
119
+ pg_team_links . each do |pg_team_link |
120
+ mongo_team_link = mongo_team_links . select { |tl | tl . name == pg_team_link . name } . first
121
+
122
+ %i( url name ) . each do |attr |
123
+ neq ( attr , pg_team_link , mongo_team_link , false )
124
+ end
125
+ end
126
+
127
+ puts '----------------------------------------------------------------------------------------------------'
128
+ puts 'MEMBERS'
129
+ puts '----------------------------------------------------------------------------------------------------'
130
+
131
+ if pg_team . members . count != mongo_team . team_members . count
132
+ puts "members | pg:#{ pg_team . id } | mongo:#{ mongo_team . id } | #{ mongo_team . team_members . count } != #{ pg_team . members . count } "
133
+ end
134
+
84
135
85
- # TODO: Members
136
+ puts '----------------------------------------------------------------------------------------------------'
137
+ puts 'JOBS'
138
+ puts '----------------------------------------------------------------------------------------------------'
86
139
87
- # TODO: Jobs
140
+ pg_team . jobs . each do |pg_team_job |
141
+ mongo_team_job = Team . where ( id : pg_team_job . team_document_id . to_s ) . first
142
+
143
+ neq ( :name , pg_team_job , mongo_team_job , false )
144
+ end
88
145
89
- # TODO: Followers
146
+ puts '----------------------------------------------------------------------------------------------------'
147
+ puts 'FOLLOWERS'
148
+ puts '----------------------------------------------------------------------------------------------------'
149
+
150
+ pg_team . followers . each do |pg_team_follower |
151
+ mongo_team_follower = Team . where ( id : pg_team_follower . mongo_id . to_s ) . first
152
+ # admins
153
+ # editors
154
+ %i( about achievement_count analytics avatar benefit_description_1 benefit_description_2 benefit_description_3 benefit_name_1 benefit_name_2 benefit_name_3 big_image big_quote blog_feed branding country_id created_at endorsement_count facebook featured_banner_image featured_links_title github_organization_name headline hide_from_featured highlight_tags hiring_tagline interview_steps invited_emails link_to_careers_page location mean median monthly_subscription name number_of_jobs_to_show office_photos organization_way organization_way_name organization_way_photo our_challenge paid_job_posts pending_join_requests premium preview_code reason_description_1 reason_description_2 reason_description_3 reason_name_1 reason_name_2 reason_name_3 score size slug stack_list total twitter upcoming_events updated_at upgraded_at valid_jobs website why_work_image your_impact youtube_url ) . each do |attr |
155
+ neq ( attr , pg_team_follower , mongo_team_follower , false )
156
+ end
157
+ end
90
158
91
159
# TODO: Pending Requests
92
160
0 commit comments