search_rails 1.0.7 → 1.0.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edc61245c217ca91ddcceb656bac50fd9b5dcfae
4
- data.tar.gz: 57cd6f279958c5f0581ba8d2500280accf7a5988
3
+ metadata.gz: 23ba4b1c01ed3731d27e47a339c7715ae0f91f58
4
+ data.tar.gz: 6c40acc7f948e9ea8da19e2db97219069139d49c
5
5
  SHA512:
6
- metadata.gz: 97d9b62a8043c5a5fdd1e1e2b6a2b578f8fe85993c7581b86de7fc6ffab8405798504920680ec692973a2ccccb7149fe9c4ba63acd26c22eee7e28676280c4c2
7
- data.tar.gz: e89562ad47926e96d365774c98bfff28d57138493d9dda169ef0b523888ee71b0cefe6ae390454bb13d93e91a7dc394e56af4cc7ac59d6b334e827c2beb6643e
6
+ metadata.gz: 76d1928a0bb57cc015f582beba534091f299700fb9a26fee3f7c0bf1e30da594c967bdc2e97b27dfd24842bfd0da74ba6371cf1e3a776b99c087743ce1b92488
7
+ data.tar.gz: 7da3d23314c7a9dfc8615cb339b879d709256180d1d1f2366ab0a304c7c289dd8d1ffeefec25cfb6bf720a7bc3c7ea06abd9b9ac2f55e799c6eb3efb816435c9
data/README.md CHANGED
@@ -55,6 +55,8 @@ end
55
55
 
56
56
  This is still a work in progress, so if there are any issues, please report them on the GitHub page.
57
57
 
58
+ #### Hopefully in the future, automatic support for Devise will be included, but for now, you will have to modify the files 'search:install' makes on your own for devise or multi-user use.
59
+
58
60
 
59
61
  ## Contributing
60
62
 
@@ -1,3 +1,3 @@
1
1
  module SearchRails
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
data/lib/search_rails.rb CHANGED
@@ -42,7 +42,13 @@ module SearchRails
42
42
  attributes.each do |attri|
43
43
  attribute = attri.split(':')
44
44
  if attribute[1] == 'integer' || attribute[1] == 'decimal'
45
- line.puts " " + object.capitalize.singularize + ".where('cast(" + attribute[0] + " AS VARCHAR) LIKE ?', '%' + @search.search + '%').each { |" + attribute[0] + "| @" + object.downcase.pluralize + ".any? { |f| f.id == " + attribute[0] + ".id } ? true : @" + object.downcase.pluralize + " << " + attribute[0] + " }"
45
+ line.puts " " + object.capitalize.singularize + ".where('cast(" + attribute[0] + " AS VARCHAR) LIKE ?', '%' + @search.search + '%').each { |" + attribute[0] + "| @" + object.downcase.pluralize + ".any? { |f| f.id == " + attribute[0] + ".id } ? true : @" + object.downcase.pluralize + " << " + attribute[0] + " }"
46
+ elsif attribute[1] == 'boolean'
47
+ line.puts " if @search.search.downcase == 'true' || @search.search.downcase == 'tru' || @search.search.downcase == 'tr' || @search.search.downcase == 't'"
48
+ line.puts " " + object.capitalize.singularize + ".where(" + attribute[0] + ": true).each { |" + attribute[0] + "| @" + object.downcase.pluralize + ".any? { |f| f.id == " + attribute[0] + ".id } ? true : @" + object.downcase.pluralize + " << " + attribute[0] + " }"
49
+ line.puts " else @search.search.downcase == 'false' || @search.search.downcase == 'fals' || @search.search.downcase == 'fal' || @search.search.downcase == 'fa' || @search.search.downcase == 'f'"
50
+ line.puts " " + object.capitalize.singularize + ".where(" + attribute[0] + ": false).each { |" + attribute[0] + "| @" + object.downcase.pluralize + ".any? { |f| f.id == " + attribute[0] + ".id } ? true : @" + object.downcase.pluralize + " << " + attribute[0] + " }"
51
+ line.puts " end"
46
52
  else
47
53
  line.puts " " + object.capitalize.singularize + ".where('lower(" + attribute[0] + ") LIKE ?', '%' + @search.search + '%').each { |" + attribute[0] + "| @" + object.downcase.pluralize + ".any? { |f| f.id == " + attribute[0] + ".id } ? true : @" + object.downcase.pluralize + " << " + attribute[0] + " }"
48
54
  end
data/search_rails.gemspec CHANGED
@@ -10,7 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["micahnicodemus22@gmail.com"]
11
11
 
12
12
  spec.summary = "A Simple Search Gem"
13
- spec.description = "A Simple Search Gem For Searching In Rails Projects. In Development."
13
+ spec.description = "A Simple Search Gem For Searching In Rails Projects.
14
+ As Of Now, Devise or multi-user use is not included, so you will have to modify the files yourself if you want multi-user support."
14
15
  spec.homepage = "https://github.com/micahnico/search_rails"
15
16
  spec.license = "MIT"
16
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - micahnico22
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,9 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.8.1
69
- description: A Simple Search Gem For Searching In Rails Projects. In Development.
69
+ description: |-
70
+ A Simple Search Gem For Searching In Rails Projects.
71
+ As Of Now, Devise or multi-user use is not included, so you will have to modify the files yourself if you want multi-user support.
70
72
  email:
71
73
  - micahnicodemus22@gmail.com
72
74
  executables: