mongoid-normalize-strings 0.1.2 → 0.1.3

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: 5c8f5b946c31422dd72bf60ffd097e05579a4288
4
- data.tar.gz: 48cb794dbf043c995209ad4385c4af11e6a65a0c
3
+ metadata.gz: 6a7bdf3d2549820f09cf9901087e3f2e642d5a6d
4
+ data.tar.gz: 3d42a5cc937f73a42ea11e0e523d6e6290024fca
5
5
  SHA512:
6
- metadata.gz: d12f769ee48c5985f1117d0f2fbf56834ab4e630a06dee577961178a190e6c1c59817ee55e5c3a3d13d122166ef86b4bdab0cff5d9e1e743708e66999b37dcdf
7
- data.tar.gz: f77e99f99e9ed7c68fad1fa6043b5a6b66157d0977f237bbf67c01da48ce7550596ac534dd408a2c4edb74ac3e39a9c9d6b7901db716636016022738fab03581
6
+ metadata.gz: 889b4a15c9f7cfb77ed8bea3fbbbf072a277ced4e3b90207352403daeef652ce5253ba13c93953cca129a923d6fcbbba9feb3cd1829d85d2f313b6e32bef26fb
7
+ data.tar.gz: 18618fb0fb45f1fd6296296286432d59cba19481711d867c814444f5dd1ba4c052efd9fb2044204a8f73f986755b20ee608e2f986e75d0c740ba897c086fdf17
@@ -37,7 +37,7 @@ module Mongoid
37
37
  base.send(:before_validation) do
38
38
  self.class.normalized_fields.each do |field_name|
39
39
  if self[field_name]
40
- self["#{field_name}_normalized"] = I18n.transliterate(self[field_name]).downcase
40
+ self["#{field_name}_normalized"] = I18n.transliterate(self[field_name]).downcase.strip
41
41
  end
42
42
  end
43
43
  end
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module NormalizeStrings
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -11,7 +11,7 @@ describe Mongoid::NormalizeStrings do
11
11
 
12
12
  describe 'hooks' do
13
13
  it 'normalize fields after create' do
14
- city = City.create(name: 'Córdoba')
14
+ city = City.create(name: ' Córdoba ')
15
15
  expect(city.name_normalized).to eq('cordoba')
16
16
  end
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-normalize-strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Jurado