column_like 0.0.7 → 0.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: 25a2e5be59209cc0cb810d2a65aed673d3fa4d93
4
- data.tar.gz: 40b48b39668ae6409a9adce6f37db49e4ac57f27
3
+ metadata.gz: 49f3134827d9e5b48404ead64c63b5916104b9fb
4
+ data.tar.gz: 9c86bab6c03806ccfbe032b9eb1d1ad07ed00952
5
5
  SHA512:
6
- metadata.gz: ab266eb8a2d581342f5a578f94ced2d82201bab5d6c29064e8cb3db5ca434e5e83129ed971e8f0a82d06dca395281b2843ac239d533c1d5c2ae3094254e40a63
7
- data.tar.gz: db502068990a2f343d6044cfc53f2d6a0abd4b3b43c458daaa7ecf4ab75b361294e67258d3ea7c2e9997271f5e532f1685e2c7d62ce4f08ea3bd7514bc362942
6
+ metadata.gz: 082e3378725a28973384faec1eff20c2fee72f82d5c50dd939287613da81e40051a4737b5f81c13330298cf5f3d47f104ae302a0f0e33836293b092aa6b4553d
7
+ data.tar.gz: 76c8ff96cc570b8b3c12cdee05d24d7544014f131e299abea0d6f58b9828511de0cb0c4c87878a5caa770b6921682afaa4c7667046e59d95df9ee4b9565cc0de
@@ -3,7 +3,11 @@ class ActiveRecord::Base
3
3
  if (method_sym.to_s =~ /^(.*)_like$/)==0
4
4
  column=method_sym.to_s.split('_like').flatten.first
5
5
  if column_names.include? column
6
+ if ((arguments.first.include? '%') || (arguments.first.include? '*') || (arguments.first.include? '_'))
7
+ self.where("lower(#{column}) like ?","#{arguments.first.downcase}")
8
+ else
6
9
  self.where("lower(#{column}) like ?","%#{arguments.first.downcase}%")
10
+ end
7
11
  else
8
12
  puts "*"*10+"You might want to check field name again"+"*"*10
9
13
  super
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: column_like
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satyam Singh
@@ -32,12 +32,14 @@ extra_rdoc_files: []
32
32
  files:
33
33
  - lib/generators/column_like/install_generator.rb
34
34
  - lib/generators/column_like/templates/column_like_initializer.rb
35
- homepage: https://github.com/SinghSatyam/column_like
35
+ homepage: http://singhsatyam.github.io/column_like
36
36
  licenses:
37
37
  - MIT
38
38
  metadata: {}
39
- post_install_message: "*************** Run 'rails g column_like:install' to finish
40
- installing column_like***************"
39
+ post_install_message: |
40
+ ==== Post Install Message From Column Like ====
41
+ Please run 'rails generate column_like:install' from your terminal to finish installating column_like.
42
+ ===============================================
41
43
  rdoc_options: []
42
44
  require_paths:
43
45
  - lib