auto_define_scope 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 144d6a561d4ff489c2121c0838ed0d5cee048f677c595613b7aa6a80f3800154
4
- data.tar.gz: b23ab4f24d3e0e8746f81f586bb3a504a37a0e44daa9760a95ad09295d01a4e0
3
+ metadata.gz: 9e2dc8de05d089a3b8c75c03fb1967b536063b20e3adf17362ab67779f923ec9
4
+ data.tar.gz: e27d1cc17bd525d5c18eb06351497d0e32aa3e499d39616a6a0a887c7367b4f3
5
5
  SHA512:
6
- metadata.gz: f6e446133f357a96e3fce23d0f6f7c5be92b9ecdd364c01324ea71314d261de14741bf381074c966504d0cfb4d8276e32bfe2b64eb5c7c1b60d3147beb35809a
7
- data.tar.gz: 88d2fde9594e696a5180c8430f7b04e699fbd48b7cbe42c520b4ef5d43d127bf27a0ee2bdb3a440628534b6daca78d4491c2bade62a26dfccc27dfb7b5a20873
6
+ metadata.gz: 60e33b821b74ecc0fbe5b74ce1ed8f2c80d5b6c9747dbe41fb28aa37258ecdfbd406a96ccda2b64b449dd764fb6f250d9fe0dacb148131f1c28b7a61460a570e
7
+ data.tar.gz: 6911588c11b607c161267dcde080b376885e9014869f489d4068a26e0e6724a3ce2f7a814b2d8a9669507f3bfab3437942aa09f3e45874a989470741119e0695
data/README.md CHANGED
@@ -32,8 +32,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
32
 
33
33
  ## Contributing
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/auto_define_scope. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/tinyfeng/auto_define_scope. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
36
 
37
37
  ## Code of Conduct
38
38
 
39
- Everyone interacting in the AutoDefineScope project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/auto_define_scope/blob/master/CODE_OF_CONDUCT.md).
39
+ Everyone interacting in the AutoDefineScope project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/tinyfeng/auto_define_scope/blob/master/CODE_OF_CONDUCT.md).
@@ -11,14 +11,14 @@ Gem::Specification.new do |spec|
11
11
  spec.license = 'MIT'
12
12
 
13
13
  spec.summary = %q{Auto defined scopes filterrific needs.}
14
- spec.homepage = "https://github.com/tinyfeng/auto_define_scope/blob/master"
14
+ spec.homepage = "https://github.com/tinyfeng/auto_define_scope"
15
15
 
16
16
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
17
  # to allow pushing to a single host or delete this section to allow pushing to any host.
18
18
  if spec.respond_to?(:metadata)
19
19
 
20
20
  spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/tinyfeng/auto_define_scope/blob/master"
21
+ spec.metadata["source_code_uri"] = "https://github.com/tinyfeng/auto_define_scope"
22
22
  else
23
23
  raise "RubyGems 2.0 or newer is required to protect against " \
24
24
  "public gem pushes."
@@ -50,12 +50,12 @@ module AutoDefineScope
50
50
  @auto_define_scopes ||= []
51
51
  scope_name = "#{type}_#{joins_params_array.last&.to_s&.+ '_'}#{c}"
52
52
  @auto_define_scopes << scope_name
53
- scope scope_name, ->(v){ joins(joins_params).where("#{table_name}.#{c} #{OPERATE_SQL[type]}", value_of_type(v, type)) }
53
+ scope scope_name, ->(v){ joins(joins_params).where("#{table_name}.#{c} #{OPERATE_SQL[type]}", sql_of_type(v, type)) }
54
54
  end
55
55
  nil
56
56
  end
57
57
 
58
- def value_of_type value, type
58
+ def sql_of_type value, type
59
59
  type == :with ? value : "%#{value}%"
60
60
  end
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module AutoDefineScope
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_define_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tinyfeng.hou
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,12 +72,12 @@ files:
72
72
  - lib/auto_define_scope/active_record_extension.rb
73
73
  - lib/auto_define_scope/engine.rb
74
74
  - lib/auto_define_scope/version.rb
75
- homepage: https://github.com/tinyfeng/auto_define_scope/blob/master
75
+ homepage: https://github.com/tinyfeng/auto_define_scope
76
76
  licenses:
77
77
  - MIT
78
78
  metadata:
79
- homepage_uri: https://github.com/tinyfeng/auto_define_scope/blob/master
80
- source_code_uri: https://github.com/tinyfeng/auto_define_scope/blob/master
79
+ homepage_uri: https://github.com/tinyfeng/auto_define_scope
80
+ source_code_uri: https://github.com/tinyfeng/auto_define_scope
81
81
  post_install_message:
82
82
  rdoc_options: []
83
83
  require_paths: