This file contains hidden or 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
require 'elasticsearch/model' | |
module Concerns | |
module Author | |
module Searchable | |
extend ActiveSupport::Concern | |
included do | |
include Elasticsearch::Model | |
include Elasticsearch::Model::Callbacks | |
This file contains hidden or 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
/* | |
We have an array of objects representing different people in our contacts lists. | |
A lookUpProfile function that takes firstName and a property (prop) as arguments has been pre-written for you. | |
The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact. | |
If both are true, then return the "value" of that property. | |
If firstName does not correspond to any contacts then return "No such contact" | |
If prop does not correspond to any valid properties then return "No such property" | |
*/ | |
//Setup |
NewerOlder