Skip to content

Commit 0b3226c

Browse files
committed
used first instead of find; match was inverted
1 parent d224530 commit 0b3226c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/patron/employee.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def hr_data
8787
end
8888

8989
def campus_code_from_inst_role
90-
umichinstrole = @data["umichinstroles"].first { |x| inst_role_base.match?(x) }
91-
Patron.inst_role_map.first { |x| x["key"] == umichinstrole }["campus"]
90+
umichinstrole = @data["umichinstroles"].find { |x| x.match?(inst_role_base) }
91+
Patron.inst_role_map.find { |x| x["key"] == umichinstrole }["campus"]
9292
end
9393
end
9494
end

spec/patron/faculty_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
expect(subject.campus_code).to eq("UMFL")
2020
end
2121
it "comes from first faculty matched inst role when not hr data" do
22-
@patron["umichinstroles"].push("FacultyAA")
22+
@patron["umichinstroles"][1] = "FacultyDBRN"
2323
@patron["umichhr"] = []
24-
expect(subject.campus_code).to eq("UMAA")
24+
expect(subject.campus_code).to eq("UMDB")
2525
end
2626
end
2727
context "#includable?" do

0 commit comments

Comments
 (0)