client_side_validations-mongoid 7.0.0 → 8.0.0

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: 50dd7d73e4cb0f270ccf53fe63551c5d6498d554
4
- data.tar.gz: 94a5d2d8a42a7408ddfb35b92cd3a8e40c2db5d4
3
+ metadata.gz: 7e8e2d659871264d9ddaf87d278cc062350d2b68
4
+ data.tar.gz: 4ee681ddaaaa9d6641d03e71e2ddf909f0bafe68
5
5
  SHA512:
6
- metadata.gz: 277f4e696eb2988989a380d151c887116f85299c2f15793befc5da95d7c08cbe24c1dd687a16f4cbab681bcdbfe16660966ef4b5b973d7554209fa594ac4657c
7
- data.tar.gz: 85b6905e437ebc98967a43d626a841d2827f16057da42567a62ecab3d099c376d9038a92a47a2ab7f5fcbd2a6b4ad77b32eab939580396e16ed1f29fd326c754
6
+ metadata.gz: 4c06e89254662aea00aa3477ca3305e12c77168f7766c76661135510fe4c54292fd58aaaf800275511e99dd01e83b51a15ea2d593ce9a6c44c05a2d72b1de395
7
+ data.tar.gz: daefd967d80962c898e9c05a455ce228dc6998a6823b0cf2d5ae6d1b025efb6d1a80e7d28fe14de1f01fc069db7af5b185abf8e0e5a29b2ecf37b19681897770
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.0 (2017-01-20)
4
+
5
+ * ClientSideValidations 7.0 compatibility
6
+
3
7
  ## 7.0.0 (2017-01-20)
4
8
 
5
9
  * ClientSideValidations 6.0 compatibility
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Code Climate](https://codeclimate.com/github/DavyJonesLocker/client_side_validations-mongoid/badges/gpa.svg)](https://codeclimate.com/github/DavyJonesLocker/client_side_validations-mongoid)
7
7
  [![Coverage Status](https://coveralls.io/repos/DavyJonesLocker/client_side_validations-mongoid/badge.svg?branch=master)](https://coveralls.io/r/DavyJonesLocker/client_side_validations-mongoid?branch=master)
8
8
 
9
- [Mongoid](https://github.com/plataformatec/mongoid) plugin for [ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations)
9
+ [Mongoid](https://docs.mongodb.com/ruby-driver/master/mongoid/#ruby-mongoid-tutorial) plugin for [ClientSideValidations](https://github.com/DavyJonesLocker/client_side_validations)
10
10
 
11
11
  ## Installation ##
12
12
 
@@ -36,7 +36,7 @@ The usage is the same as `ClientSideValidations`, just pass `validate: true` to
36
36
  Per-input options are done with `:validate`
37
37
 
38
38
  ```ruby
39
- <%= book.input :name, validate: { presence: true, uniqueness: false }
39
+ <%= book.input :name, validate: { presence: true, uniqueness: false } %>
40
40
  ```
41
41
 
42
42
  ## Authors ##
@@ -1,8 +1,4 @@
1
1
  require 'client_side_validations/active_model'
2
- require 'client_side_validations/middleware'
3
- require 'client_side_validations/mongoid/middleware'
4
-
5
- ClientSideValidations::Middleware::Uniqueness.register_orm(ClientSideValidations::Mongoid::Middleware)
6
2
 
7
3
  %w(Presence Uniqueness).each do |validator|
8
4
  require "client_side_validations/mongoid/#{validator.downcase}"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module ClientSideValidations
3
3
  module Mongoid
4
- VERSION = '7.0.0'.freeze
4
+ VERSION = '8.0.0'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-20 00:00:00.000000000 Z
12
+ date: 2017-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: client_side_validations
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '6.0'
20
+ version: '7.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '6.0'
27
+ version: '7.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mongoid
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 0.8.18
76
+ version: 0.8.19
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: 0.8.18
83
+ version: 0.8.19
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: database_cleaner
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -113,22 +113,16 @@ dependencies:
113
113
  name: minitest
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: 4.7.5
119
- - - "<"
116
+ - - "~>"
120
117
  - !ruby/object:Gem::Version
121
- version: 6.0.0
118
+ version: '5.10'
122
119
  type: :development
123
120
  prerelease: false
124
121
  version_requirements: !ruby/object:Gem::Requirement
125
122
  requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- version: 4.7.5
129
- - - "<"
123
+ - - "~>"
130
124
  - !ruby/object:Gem::Version
131
- version: 6.0.0
125
+ version: '5.10'
132
126
  - !ruby/object:Gem::Dependency
133
127
  name: mocha
134
128
  requirement: !ruby/object:Gem::Requirement
@@ -196,7 +190,6 @@ files:
196
190
  - CHANGELOG.md
197
191
  - README.md
198
192
  - lib/client_side_validations/mongoid.rb
199
- - lib/client_side_validations/mongoid/middleware.rb
200
193
  - lib/client_side_validations/mongoid/presence.rb
201
194
  - lib/client_side_validations/mongoid/uniqueness.rb
202
195
  - lib/client_side_validations/mongoid/version.rb
@@ -220,8 +213,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
213
  version: '0'
221
214
  requirements: []
222
215
  rubyforge_project:
223
- rubygems_version: 2.6.8
216
+ rubygems_version: 2.6.9
224
217
  signing_key:
225
218
  specification_version: 4
226
- summary: Mongoid Plugin for ClientSideValidations
219
+ summary: ClientSideValidations Mongoid
227
220
  test_files: []
@@ -1,25 +0,0 @@
1
- module ClientSideValidations
2
- module Mongoid
3
- class Middleware
4
- def self.class?(klass)
5
- klass < ::Mongoid::Document
6
- end
7
-
8
- # Still need to handle embedded documents
9
- def self.unique?(klass, attribute, value, params)
10
- if params[:case_sensitive] == 'false'
11
- value = Regexp.new("^#{Regexp.escape(value.to_s)}$", Regexp::IGNORECASE)
12
- end
13
-
14
- criteria = klass.where(attribute => value)
15
- criteria = criteria.where(_id: { '$ne' => params[:id] }) if params[:id]
16
-
17
- (params[:scope] || {}).each do |scope_key, scope_value|
18
- criteria = criteria.where(scope_key => scope_value)
19
- end
20
-
21
- criteria.empty?
22
- end
23
- end
24
- end
25
- end