query_methods_extend 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 751bd8940dadfc4c6d65ea648ce49868b0d8e366
4
- data.tar.gz: 28ac09fa9a5c36060b61b4103b2072a8c82f736c
3
+ metadata.gz: 92bc332107fea0d943bd445ed9f3449f89852608
4
+ data.tar.gz: e9c696a7b9f18bf19d010aaa4154f8374651f3b4
5
5
  SHA512:
6
- metadata.gz: 1038ddcb987eb19e450e43f943e349f0f2ef233c27f1af0565233a1714e96558f28f191065b01e541159b33c8ed529b3f2f48263dec7a5f6877e8f9ccc7ee0d8
7
- data.tar.gz: 2be7a69f1e282163e61adf5a4094f8b12c69f9c78955748f4291eab095f202f9b88cbac04b2783466bd9dc55240bcb655b7745d1ede3990e8faba81a48f4982d
6
+ metadata.gz: c4e4210ab6236a76cb7735f28d8d36f80084a76c9d2be604010dd362c09f695373965bf2f4f21f06f3ec31a19de95a48adb6a23edac4ad61a8a7e5770d68fce8
7
+ data.tar.gz: fe68bbc1c89c29289082e48dd41706340d24a3c37128f6d5bf4f2937f78b4b1e23041a4b1c259382e9570a9e05681329e17174ea6ced6a2c54106139e12dfc09
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # QueryMethodsExtend
2
2
 
3
3
  Extend query activerecord in rails 4
4
+ https://rubygems.org/gems/query_methods_extend
4
5
 
5
6
  ## Installation
6
7
 
@@ -147,7 +148,7 @@ SELECT "books".* FROM "books" WHERE (books.price >= 5)
147
148
 
148
149
  ## Contributing
149
150
 
150
- 1. Fork it ( https://github.com/[my-github-username]/query_methods_extend/fork )
151
+ 1. Fork it ( https://github.com/alicuche/query_methods_extend/fork )
151
152
  2. Create your feature branch (`git checkout -b my-new-feature`)
152
153
  3. Commit your changes (`git commit -am 'Add some feature'`)
153
154
  4. Push to the branch (`git push origin my-new-feature`)
@@ -4,22 +4,22 @@ module QueryMethodsExtend
4
4
  attr_accessor :extend_like_string
5
5
 
6
6
  scope :like, ->(agrs){
7
- @extend_like_string = '%?%'
7
+ @extend_like_string = '%{?}%'
8
8
  like_basic agrs
9
9
  }
10
10
 
11
11
  scope :l_like, ->(agrs){
12
- @extend_like_string = '%?'
12
+ @extend_like_string = '%{?}'
13
13
  like_basic agrs
14
14
  }
15
15
 
16
16
  scope :r_like, ->(agrs){
17
- @extend_like_string = '?%'
17
+ @extend_like_string = '{?}%'
18
18
  like_basic agrs
19
19
  }
20
20
 
21
21
  scope :regex_like, ->(agrs){
22
- @extend_like_string = '?'
22
+ @extend_like_string = '{?}'
23
23
  like_basic agrs
24
24
  }
25
25
 
@@ -28,7 +28,7 @@ module QueryMethodsExtend
28
28
  items = self
29
29
  agrs.each do |agr|
30
30
  field, value = agr
31
- items = items.where("#{self.table_name}.#{field} LIKE ?", @extend_like_string.gsub('?', value.to_s))
31
+ items = items.where("#{self.table_name}.#{field} LIKE ?", @extend_like_string.gsub('{?}', value.to_s))
32
32
  end
33
33
  return items
34
34
  else
@@ -1,3 +1,3 @@
1
1
  module QueryMethodsExtend
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_methods_extend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alicuche