finapps 5.0.30 → 5.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yaml +37 -0
  3. data/.rubocop.yml +134 -61
  4. data/.rubocop_todo.yml +29 -0
  5. data/.tmuxinator.yml +1 -0
  6. data/.travis.yml +3 -1
  7. data/README.md +1 -0
  8. data/RELEASES.md +29 -0
  9. data/finapps.gemspec +4 -4
  10. data/lib/finapps/rest/alert_definitions.rb +1 -1
  11. data/lib/finapps/rest/alert_occurrences.rb +1 -1
  12. data/lib/finapps/rest/client.rb +6 -5
  13. data/lib/finapps/rest/consumers.rb +22 -6
  14. data/lib/finapps/rest/consumers_portfolios.rb +1 -1
  15. data/lib/finapps/rest/documents_orders.rb +43 -26
  16. data/lib/finapps/rest/operators.rb +5 -5
  17. data/lib/finapps/rest/operators_password_resets.rb +1 -1
  18. data/lib/finapps/rest/order_assignments.rb +1 -1
  19. data/lib/finapps/rest/order_reports.rb +1 -1
  20. data/lib/finapps/rest/orders.rb +33 -22
  21. data/lib/finapps/rest/plaid/plaid_consumer_institutions.rb +1 -1
  22. data/lib/finapps/rest/portfolio_reports.rb +1 -1
  23. data/lib/finapps/rest/portfolios.rb +1 -1
  24. data/lib/finapps/rest/portfolios_available_consumers.rb +1 -1
  25. data/lib/finapps/rest/portfolios_consumers.rb +1 -1
  26. data/lib/finapps/rest/sessions.rb +11 -9
  27. data/lib/finapps/rest/signed_documents_downloads.rb +3 -1
  28. data/lib/finapps/utils/query_builder.rb +13 -4
  29. data/lib/finapps/version.rb +1 -1
  30. data/spec/rest/alert_definitions_spec.rb +10 -6
  31. data/spec/rest/alert_occurrences_spec.rb +6 -1
  32. data/spec/rest/api_request.rb +1 -0
  33. data/spec/rest/client_spec.rb +33 -41
  34. data/spec/rest/consumers_portfolios_spec.rb +7 -2
  35. data/spec/rest/consumers_spec.rb +240 -192
  36. data/spec/rest/documents_orders_notifications_spec.rb +4 -2
  37. data/spec/rest/documents_orders_spec.rb +94 -17
  38. data/spec/rest/esign_templates_spec.rb +2 -1
  39. data/spec/rest/operators_password_resets_spec.rb +50 -52
  40. data/spec/rest/operators_spec.rb +181 -172
  41. data/spec/rest/order_assignments_spec.rb +6 -1
  42. data/spec/rest/order_notifications_spec.rb +4 -2
  43. data/spec/rest/order_refreshes_spec.rb +8 -5
  44. data/spec/rest/order_reports_spec.rb +21 -15
  45. data/spec/rest/order_statuses_spec.rb +14 -10
  46. data/spec/rest/order_tokens_spec.rb +37 -30
  47. data/spec/rest/orders_spec.rb +121 -73
  48. data/spec/rest/password_resets_spec.rb +46 -36
  49. data/spec/rest/plaid/plaid_account_permissions_spec.rb +5 -4
  50. data/spec/rest/plaid/plaid_accounts_spec.rb +9 -4
  51. data/spec/rest/plaid/plaid_consumer_institutions_spec.rb +11 -11
  52. data/spec/rest/plaid/plaid_institution_logos_spec.rb +1 -1
  53. data/spec/rest/plaid/plaid_webhooks_spec.rb +3 -1
  54. data/spec/rest/portfolio_reports_spec.rb +7 -2
  55. data/spec/rest/portfolios_alerts_spec.rb +9 -4
  56. data/spec/rest/portfolios_available_consumers_spec.rb +7 -2
  57. data/spec/rest/portfolios_consumers_spec.rb +15 -4
  58. data/spec/rest/portfolios_spec.rb +20 -17
  59. data/spec/rest/products_spec.rb +17 -14
  60. data/spec/rest/sessions_spec.rb +63 -58
  61. data/spec/rest/signed_documents_downloads_spec.rb +10 -6
  62. data/spec/rest/tenant_app_settings_spec.rb +9 -3
  63. data/spec/rest/tenant_settings_spec.rb +9 -3
  64. data/spec/rest/verix/verix_documents_spec.rb +15 -22
  65. data/spec/rest/verix/verix_metadata_spec.rb +1 -1
  66. data/spec/rest/verix/verix_pdf_documents_spec.rb +14 -19
  67. data/spec/rest/verix/verix_records_spec.rb +31 -10
  68. data/spec/rest/version_spec.rb +6 -4
  69. data/spec/spec_helper.rb +2 -2
  70. data/spec/support/fake_api.rb +9 -3
  71. data/spec/support/fixtures/documents_orders_none.json +6 -0
  72. data/spec/utils/query_builder_spec.rb +40 -14
  73. metadata +20 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c74f2340d52ad3cd13dc2bdf8415e7cf89e48f0993dbb346456546910a69ba9
4
- data.tar.gz: 3bdefc2032a2efa241d5cc72ab5d6b74fc44b568599f0054bf5477e473fab81f
3
+ metadata.gz: 4756aafb56941b9eaf0609a1aa07d9eae9b3485e70a10bf1ab7590cc973654d1
4
+ data.tar.gz: 0e55b4ed791fc263027a21b6193ca025778e983fb0742006111b9fc1c5d88e4d
5
5
  SHA512:
6
- metadata.gz: 9cb6732ca1b8ba09cc84920ec7fdd086259cd339f012f72cf19c30387f877f3af1aa495bea47f019ee638e9a32eb3f76bbd0397e89b6e773e108da98e9bc8300
7
- data.tar.gz: 5dedcdb78fa82b22011520031aae7aa55b1c6e35a7f5ccd55e16fdaa1c6d3b19bd4d17e300a00849d1768be6528b2396adff43ef96b6c6f060740af4315c857f
6
+ metadata.gz: 90031e4f43d5a3fda8f4f3f2df53e7ecb8a5e27ab53830f79aaf80ab981b293b8890ad3e2bf8a31ebc210dcaf37f29fbcc1442fb139ee463b465243223381393
7
+ data.tar.gz: 56d79d89f1a40e4ee1fff5b58ad8e49f762375c7ea6a4911a3e149004272eba89fe3e6348653a49f75a2bf1cd6a1f41ef4e8c20af6857c0e75af76c818b88467
@@ -0,0 +1,37 @@
1
+ name: Main
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ ci:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ fail-fast: true
11
+
12
+ steps:
13
+ - uses: actions/checkout@v1
14
+
15
+ - name: Use Ruby 2.6
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: '2.6'
19
+
20
+ - uses: actions/cache@v1
21
+ with:
22
+ path: vendor/bundle
23
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
24
+ restore-keys: |
25
+ ${{ runner.os }}-gems-
26
+
27
+ - name: Install gems
28
+ run: |
29
+ gem install bundler
30
+ bundle config path vendor/bundle
31
+ bundle install --jobs 4 --retry 3
32
+
33
+ - name: Run rubocop
34
+ run: bundle exec rubocop
35
+
36
+ - name: Run tests
37
+ run: bundle exec rspec
@@ -1,26 +1,59 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-rspec
5
+ - rubocop-performance
6
+
1
7
  AllCops:
2
- DisplayCopNames: true
8
+ TargetRubyVersion: 2.6
3
9
  Exclude:
4
- - "finapps.gemspec"
5
- UseCache: false
10
+ - "vendor/**/*"
11
+ - "bin/**/*"
12
+ CacheRootDirectory: tmp
6
13
 
7
- # Commonly used screens these days easily fit more than 80 characters.
14
+ Layout/SpaceAroundMethodCallOperator:
15
+ Enabled: true
16
+ Layout/EmptyLinesAroundAttributeAccessor:
17
+ Enabled: true
18
+ Layout/SpaceInsideBlockBraces:
19
+ # The space here provides no real gain in readability while consuming
20
+ # horizontal space that could be used for a better parameter name.
21
+ # Also {| differentiates better from a hash than { | does.
22
+ SpaceBeforeBlockParameters: false
23
+ Layout/SpaceInsideHashLiteralBraces:
24
+ EnforcedStyle: no_space
25
+ Layout/DotPosition:
26
+ Description: Checks the position of the dot in multi-line method calls.
27
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
28
+ Enabled: true
29
+ EnforcedStyle: leading
30
+ SupportedStyles:
31
+ - leading
32
+ - trailing
8
33
  Layout/LineLength:
9
- Max: 120
34
+ Max: 110
10
35
 
11
- Style/CollectionMethods:
12
- Description: Preferred collection methods.
13
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
36
+ Lint/DeprecatedOpenSSLConstant:
14
37
  Enabled: true
15
- PreferredMethods:
16
- collect: map
17
- collect!: map!
18
- find: detect
19
- find_all: select
20
- reduce: inject
21
- Style/OptionHash:
22
- Description: Don't use option hashes when you can use keyword arguments.
23
- Enabled: false
38
+ Lint/MixedRegexpCaptureTypes:
39
+ Enabled: true
40
+ Lint/RaiseException:
41
+ Enabled: true
42
+ Lint/StructNewOverride:
43
+ Enabled: true
44
+
45
+ Metrics/ClassLength:
46
+ Exclude:
47
+ - app/controllers/orders_controller.rb
48
+ - app/models/order.rb
49
+ Metrics/BlockLength:
50
+ ExcludedMethods: ['describe', 'context']
51
+ Exclude:
52
+ - config/environments/**/**
53
+ - Guardfile
54
+ - config/routes.rb
55
+ - config/Guardfile
56
+
24
57
  Naming/PredicateName:
25
58
  Description: Check the names of predicate methods.
26
59
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
@@ -33,54 +66,94 @@ Naming/PredicateName:
33
66
  - is_
34
67
  Exclude:
35
68
  - spec/**/*
36
- Metrics/AbcSize:
37
- Description: A calculated magnitude based on number of assignments, branches, and
38
- conditions.
39
- Enabled: false
40
- Max: 15
41
- Metrics/BlockLength:
42
- ExcludedMethods: ['describe', 'context']
43
- Metrics/ClassLength:
44
- Description: Avoid classes longer than 100 lines of code.
45
- Enabled: false
46
- CountComments: false
47
- Max: 100
48
- Metrics/ModuleLength:
49
- CountComments: false
50
- Max: 100
51
- Description: Avoid modules longer than 100 lines of code.
52
- Enabled: false
53
- Metrics/CyclomaticComplexity:
54
- Description: A complexity metric that is strongly correlated to the number of test
55
- cases needed to validate a method.
56
- Enabled: false
57
- Max: 6
58
- Metrics/MethodLength:
59
- Description: Avoid methods longer than 10 lines of code.
60
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
69
+
70
+ RSpec/FilePath:
61
71
  Enabled: false
62
- CountComments: false
63
- Max: 10
64
- Metrics/ParameterLists:
65
- Description: Avoid parameter lists longer than three or four parameters.
66
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
72
+
73
+ Style/RedundantRegexpCharacterClass:
74
+ Enabled: true
75
+ Style/RedundantRegexpEscape:
76
+ Enabled: true
77
+ Style/CollectionMethods:
78
+ Description: Preferred collection methods.
79
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
80
+ Enabled: true
81
+ PreferredMethods:
82
+ collect: map
83
+ collect!: map!
84
+ find: detect
85
+ find_all: select
86
+ reduce: inject
87
+ Style/GuardClause:
88
+ Description: Check for conditionals that can be replaced with guard clauses
89
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
90
+ Enabled: true
91
+ MinBodyLength: 1
92
+ Style/OptionHash:
93
+ Description: Don't use option hashes when you can use keyword arguments.
67
94
  Enabled: false
68
- Max: 5
69
- CountKeywordArgs: true
70
- Metrics/PerceivedComplexity:
71
- Description: A complexity metric geared towards measuring complexity for a human
72
- reader.
95
+ Style/PercentLiteralDelimiters:
96
+ Description: Use `%`-literal delimiters consistently
97
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
73
98
  Enabled: false
74
- Max: 7
99
+ PreferredDelimiters:
100
+ "%": "()"
101
+ "%i": "()"
102
+ "%q": "()"
103
+ "%Q": "()"
104
+ "%r": "{}"
105
+ "%s": "()"
106
+ "%w": "()"
107
+ "%W": "()"
108
+ "%x": "()"
109
+ Style/SignalException:
110
+ Description: Checks for proper usage of fail and raise.
111
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
112
+ Enabled: true
113
+ EnforcedStyle: semantic
114
+ SupportedStyles:
115
+ - only_raise
116
+ - only_fail
117
+ - semantic
118
+ Style/StringLiterals:
119
+ Description: Checks if uses of quotes match the configured preference.
120
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
121
+ Enabled: true
122
+ EnforcedStyle: single_quotes
123
+ SupportedStyles:
124
+ - single_quotes
125
+ - double_quotes
126
+ Style/StringLiteralsInInterpolation:
127
+ Description: Checks if uses of quotes inside expressions in interpolated strings
128
+ match the configured preference.
129
+ Enabled: true
130
+ EnforcedStyle: single_quotes
131
+ SupportedStyles:
132
+ - single_quotes
133
+ - double_quotes
75
134
  Style/Documentation:
76
135
  Description: Document classes and non-namespace modules.
77
136
  Enabled: false
78
- Style/EmptyLiteral:
79
- Description: Prefer literals to Array.new/Hash.new/String.new.
80
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
81
- Enabled: false
82
- Style/VariableInterpolation:
83
- Description: Don't interpolate global, instance and class variables directly in
84
- strings.
85
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
137
+ Style/OneLineConditional:
138
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
139
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
86
140
  Enabled: false
141
+ Style/ExponentialNotation:
142
+ Enabled: true
143
+ Style/HashEachMethods:
144
+ Enabled: true
145
+ Style/HashTransformKeys:
146
+ Enabled: true
147
+ Style/HashTransformValues:
148
+ Enabled: true
149
+ Style/RedundantFetchBlock:
150
+ Enabled: true
151
+ Style/SlicingWithRange:
152
+ Enabled: true
153
+
154
+ RSpec/NestedGroups:
155
+ Max: 5
156
+ RSpec/DescribeClass:
157
+ Exclude:
158
+ - spec/system/*
159
+ - spec/factories_spec.rb
@@ -0,0 +1,29 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-06-24 14:28:46 UTC using RuboCop version 0.86.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: CountComments, ExcludedMethods.
11
+ # ExcludedMethods: refine
12
+ # finapps.gemspec - leaving as is intentionally
13
+ Metrics/BlockLength:
14
+ Max: 28
15
+
16
+ # Offense count: 1
17
+ # Configuration parameters: CountComments.
18
+ # fake_api.rb - leaving as is intentionally
19
+ Metrics/ClassLength:
20
+ Max: 431
21
+
22
+ # Offense count: 5
23
+ # Configuration parameters: Max.
24
+ # Leaving as is intentionally - url being tested takes up as many lines
25
+ RSpec/ExampleLength:
26
+ Exclude:
27
+ - 'spec/rest/consumers_spec.rb'
28
+ - 'spec/rest/documents_orders_spec.rb'
29
+ - 'spec/rest/orders_spec.rb'
@@ -11,6 +11,7 @@ windows:
11
11
  - git pull
12
12
  - git status
13
13
  - bundle
14
+ - bundle outdated
14
15
  -
15
16
  guard:
16
17
  layout: even-horizontal
@@ -1,5 +1,7 @@
1
- sudo: false
2
1
  language: ruby
2
+ os: ["linux"]
3
+ dist: "xenial"
4
+
3
5
  cache:
4
6
  bundler: true
5
7
 
data/README.md CHANGED
@@ -3,6 +3,7 @@ FinApps Ruby-Client
3
3
  ===================
4
4
 
5
5
  [![Gem Version](https://img.shields.io/gem/v/finapps.svg)](https://rubygems.org/gems/finapps)
6
+ ![Main](https://github.com/finapps/ruby-client/workflows/Main/badge.svg)
6
7
  [![Build Status](https://travis-ci.org/finapps/ruby-client.svg?branch=master)](https://travis-ci.org/finapps/ruby-client)
7
8
  [![Code Climate](https://codeclimate.com/github/finapps/ruby-client/badges/gpa.svg)](https://codeclimate.com/github/finapps/ruby-client)
8
9
  [![Test Coverage](https://codeclimate.com/github/finapps/ruby-client/badges/coverage.svg)](https://codeclimate.com/github/finapps/ruby-client/coverage)
@@ -1,3 +1,32 @@
1
+ ## [5.0.35] - 2020-07-09
2
+
3
+ ### Changed
4
+ * Change code to match rubocop suggestions ([#232][i232])
5
+ * Add support for first name order search with space ([#404][i404])
6
+
7
+ [i232]: https://github.com/finapps/ruby-client/issues/232
8
+ [i404]: https://github.com/finapps/tenant-dashboard-react/issues/404
9
+
10
+ [5.0.35]: https://github.com/finapps/ruby-client/compare/5.0.34...5.0.35
11
+
12
+ ## [5.0.32] - 2020-06-11
13
+
14
+ ### Fixed
15
+ * Argument error resulting from space search ([#225][i225])
16
+
17
+ [i225]: https://github.com/finapps/ruby-client/issues/225
18
+
19
+ [5.0.32]: https://github.com/finapps/ruby-client/compare/5.0.31...5.0.32
20
+
21
+ ## [5.0.31] - 2020-06-11
22
+
23
+ ### Changed
24
+ * Consumer and Doc-order search to query names on spaces ([#224][i224])
25
+
26
+ [i224]: https://github.com/finapps/ruby-client/issues/224
27
+
28
+ [5.0.31]: https://github.com/finapps/ruby-client/compare/5.0.30...5.0.31
29
+
1
30
  ## [5.0.30] - 2020-05-28
2
31
 
3
32
  ### Added
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.7'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.10'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
30
30
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
31
31
  spec.add_development_dependency 'rspec', '~> 3.9', '>= 3.9.0'
32
- spec.add_development_dependency 'rubocop', '~> 0.79', '>= 0.79.0'
33
- spec.add_development_dependency 'rubocop-performance', '~> 1.5', '>= 1.5.2'
34
- spec.add_development_dependency 'rubocop-rspec', '~> 1.37', '>= 1.37.1'
32
+ spec.add_development_dependency 'rubocop', '~> 0.86', '>= 0.86.0'
33
+ spec.add_development_dependency 'rubocop-performance', '~> 1.6', '>= 1.6.1'
34
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.40', '>= 1.40.0'
35
35
  spec.add_development_dependency 'sinatra', '~> 2.0', '>= 2.0.8'
36
36
  spec.add_development_dependency 'webmock', '~> 3.8', '>= 3.8.0'
37
37
 
@@ -8,7 +8,7 @@ module FinApps
8
8
 
9
9
  def list(params = nil)
10
10
  return super END_POINT if params.nil?
11
- raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
11
+ fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
12
12
 
13
13
  super build_query_path(END_POINT, params)
14
14
  end
@@ -8,7 +8,7 @@ module FinApps
8
8
 
9
9
  def list(params = nil)
10
10
  return super END_POINT if params.nil?
11
- raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
11
+ fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
12
12
 
13
13
  super build_query_path(END_POINT, params)
14
14
  end
@@ -60,17 +60,18 @@ module FinApps
60
60
  if RESOURCES.include? symbol
61
61
  class_name = camelize(symbol.to_s)
62
62
  variable = "@#{class_name.downcase}"
63
- unless instance_variable_defined? variable
64
- klass =
65
- Object.const_get('FinApps').const_get('REST').const_get class_name
66
- instance_variable_set(variable, klass.new(self))
67
- end
63
+ set_variable(class_name, variable) unless instance_variable_defined? variable
68
64
  instance_variable_get(variable)
69
65
  else
70
66
  super
71
67
  end
72
68
  end
73
69
 
70
+ def set_variable(class_name, variable)
71
+ klass = Object.const_get('FinApps').const_get('REST').const_get class_name
72
+ instance_variable_set(variable, klass.new(self))
73
+ end
74
+
74
75
  def respond_to_missing?(method_sym, include_private = false)
75
76
  RESOURCES.include?(method_sym) ? true : super
76
77
  end
@@ -15,7 +15,7 @@ module FinApps
15
15
 
16
16
  def list(params = nil)
17
17
  return super if params.nil?
18
- raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
18
+ fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash
19
19
 
20
20
  super build_query_path(end_point, params)
21
21
  end
@@ -54,14 +54,30 @@ module FinApps
54
54
  end
55
55
 
56
56
  def search_query(term)
57
+ query = with_space_search(term).concat(name_search(term))
57
58
  {
58
- "$or": [
59
- { "email": term },
60
- { "first_name": term },
61
- { "last_name": term }
62
- ]
59
+ "$or": query
63
60
  }
64
61
  end
62
+
63
+ def with_space_search(term)
64
+ [
65
+ {"email": term},
66
+ {"first_name": term},
67
+ {"last_name": term}
68
+ ]
69
+ end
70
+
71
+ def name_search(term)
72
+ search_arr = []
73
+ if /\s/.match?(term)
74
+ term.split.each do |t|
75
+ search_arr.append("first_name": t)
76
+ search_arr.append("last_name": t)
77
+ end
78
+ end
79
+ search_arr
80
+ end
65
81
  end
66
82
  end
67
83
  end