This repository has been archived by the owner on Aug 12, 2018. It is now read-only.
forked from 401ChemistryGenealogy/ChemistryGenealogy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i can't even remember but all tests pass
- Loading branch information
Showing
9 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
require 'set' | ||
class AutoComplete | ||
def self.find(name) | ||
@name = "%#{name}%".downcase | ||
@response = Person.where("name LIKE ?", @name) | ||
@institutions = Search.get_institutions(@response) | ||
@response = Person.where("name LIKE ?", @name).includes(:institution) | ||
@institutions = Set.new | ||
@response.each do |p| | ||
@institutions.add(p.institution) | ||
end | ||
|
||
return {'people' => @response, 'institutions' => @institutions} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,13 @@ namespace :app do | |
Supervision.delete_all | ||
Mentorship.delete_all | ||
|
||
User.create!([ | ||
{ | ||
password: 'testPassword', email: '[email protected]', password_digest: 'pword', | ||
first_name: 'first', last_name: 'last', approved: true | ||
} | ||
]) | ||
|
||
# Other test data should be added here... | ||
Institution.create!([ | ||
{name: 'university of alberta', approved: true}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
#!/bin/bash | ||
# i'm sure not all these are required, but my god i've been given so many | ||
# headaches i'm just using the hammer here | ||
# uses migrations to construct database then seeds database with test data | ||
# use migrations to construct database | ||
rake db:drop | ||
rake db:migrate | ||
rake db:schema:load | ||
# seed development database with sample data etc | ||
RAILS_ENV=development rake db:seed | ||
# change to development or test depending on context | ||
# load test data into test db | ||
RAILS_ENV=test rake app:load_demo_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
=begin | ||
require 'rails_helper' | ||
|
||
RSpec.configure do |config| | ||
|
@@ -25,4 +24,3 @@ | |
end | ||
end | ||
end | ||
=end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
=begin | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.configure do |config| | ||
|
@@ -19,4 +19,3 @@ | |
end | ||
end | ||
end | ||
=end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters