levtera 0.2.2 → 0.2.3

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: f7eb703b0ae89c3ccba01d8880f84ab952f2880d
4
- data.tar.gz: 5cb90d8fce5e1f324d10164d4e512e6b379e1967
3
+ metadata.gz: e59f3fae8fb19e7da23d43b9749b8ce9f1e1bca2
4
+ data.tar.gz: b4d98e4f0a9882ac6fad30e4783323ed63d734e1
5
5
  SHA512:
6
- metadata.gz: cc7d94fe15553758a837661d764a3b3bc9d9f594458eaee97d12c4906a8322f1068a1c4b26570f9b7ba684bfd49be771a33de23495ec3accf0488ef689fde440
7
- data.tar.gz: f7224ee8e7eef88e5c61ab6fa9068ca7c1de5d536c98adfd8792238e52f15b688633b67d22e265d8e480b4dd3c30b40450d16b169194bdd4d94e7c2cd4a35478
6
+ metadata.gz: 3caf8a483f32ec443a5b008c94e3b1f3f83ddb4a07b043e8c9e5f782dcbbb4dc814828c845ab2eec52c55d7337ff8e1349944aa2a46d7dd5c54d7ca7677f7e9d
7
+ data.tar.gz: 55242836efeb8e7a0f8168eb0f3275a0ed770003e771cfd22bac89d412284960b60d592a0ba3cc2a3eb46c55dada34f3f1c9a27ed649ac7907224adecb5cece2
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- levtera (0.2.2)
14
+ levtera (0.2.3)
15
15
  mongoid
16
16
  mongoid-rspec
17
17
  rails (>= 3)
data/levtera.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  $:.push File.expand_path("../lib", __FILE__)
2
4
 
3
5
  require 'levtera/version'
@@ -14,6 +14,7 @@ module Levtera::Concerns
14
14
 
15
15
  validates :name, presence: true
16
16
  validates :vehicle_type, inclusion: { in: VEHICLE_TYPES }
17
+ validates :provider_id, uniqueness: { allow_nil: true }
17
18
  end
18
19
  end
19
20
  end
@@ -11,6 +11,7 @@ module Levtera::Concerns
11
11
  field :name, type: String
12
12
 
13
13
  validates :name, presence: true
14
+ validates :provider_id, uniqueness: { allow_nil: true, scope: :make_id }
14
15
  end
15
16
  end
16
17
  end
@@ -5,8 +5,6 @@ module Levtera::Concerns
5
5
  included do
6
6
  field :provider_id , type: String
7
7
  field :provider , type: Symbol
8
-
9
- validates :provider_id, uniqueness: {allow_nil: true}
10
8
  end
11
9
  end
12
10
  end
@@ -26,6 +26,7 @@ module Levtera::Concerns
26
26
  field :provider , type: Symbol
27
27
 
28
28
  validates :provider_id, uniqueness: { allow_nil: true, scope: :version_id }
29
+ validates :provider_id, uniqueness: { allow_nil: true, scope: :version_id }
29
30
  end
30
31
  end
31
32
  end
@@ -30,6 +30,7 @@ module Levtera::Concerns
30
30
  # validates :valves_amounts , numericality: { only_integer: true, allow_nil: true, greater_than: 0 }
31
31
  # validates :body_types , inclusion: { in: BODY_TYPES }
32
32
  # validates :transmission_types , inclusion: { in: TRANSMISSION_TYPES }
33
+ validates :provider_id, uniqueness: { allow_nil: true, scope: :model_id }
33
34
  end
34
35
  end
35
36
  end
@@ -2,7 +2,7 @@ require 'active_support'
2
2
 
3
3
  module Levtera
4
4
  # levtera version
5
- VERSION = "0.2.2"
5
+ VERSION = "0.2.3"
6
6
 
7
7
  module Concerns
8
8
  extend ActiveSupport::Autoload
@@ -3,4 +3,5 @@ shared_examples :levtera_make do
3
3
 
4
4
  it { should validate_presence_of :name }
5
5
  it { should validate_inclusion_of(:vehicle_type).on(Levtera::Concerns::Make::VEHICLE_TYPES) }
6
+ it { should validate_uniqueness_of :provider_id }
6
7
  end
@@ -2,4 +2,5 @@ shared_examples :levtera_model do
2
2
  it_should_behave_like :levtera_provided
3
3
 
4
4
  it { should validate_presence_of :name }
5
+ it { should validate_uniqueness_of(:provider_id).scoped_to(:make_id) }
5
6
  end
@@ -1,3 +1,3 @@
1
1
  shared_examples :levtera_provided do
2
- it { should validate_uniqueness_of :provider_id }
2
+
3
3
  end
@@ -4,5 +4,6 @@ shared_examples :levtera_vehicle do
4
4
  it { should validate_numericality_of(:fabrication_year).to_allow only_integer: true, allow_nil: true, greater_than: 0 }
5
5
  it { should validate_numericality_of(:model_year).to_allow only_integer: true, allow_nil: true, greater_than: 0 }
6
6
  it { should validate_inclusion_of(:engine_feeding).on(Levtera::Concerns::Vehicle::ENGINE_FEEDINGS_NAMES) }
7
+ it { should validate_uniqueness_of(:provider_id).scoped_to(:version_id) }
7
8
 
8
9
  end
@@ -8,6 +8,7 @@ shared_examples :levtera_version do
8
8
  # it { should validate_numericality_of(:valves_amount).to_allow only_integer: true, allow_nil: true, greater_than: 0 }
9
9
  # it { should validate_inclusion_of(:transmission_type).on(Levtera::Concerns::Version::TRANSMISSION_TYPES) }
10
10
  # it { should validate_inclusion_of(:body_type).on(Levtera::Concerns::Version::BODY_TYPES) }
11
+ it { should validate_uniqueness_of(:provider_id).scoped_to(:model_id) }
11
12
  end
12
13
 
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: levtera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heitor Salazar Baldelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-27 00:00:00.000000000 Z
11
+ date: 2013-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails