dm-validations 0.9.8 → 0.9.9

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.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.9.9 / 2009-01-04
2
+
3
+ * No changes this version
4
+
1
5
  === 0.9.8 / 2008-12-07
2
6
 
3
7
  * 1 bug fix:
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'pathname'
3
3
 
4
- gem 'dm-core', '~>0.9.8'
4
+ gem 'dm-core', '~>0.9.9'
5
5
  require 'dm-core'
6
6
 
7
7
  dir = Pathname(__FILE__).dirname.expand_path / 'dm-validations'
@@ -17,15 +17,14 @@ module DataMapper
17
17
  #
18
18
  # @return <Hash> a hash of validators <GenericValidator>
19
19
  def contexts
20
- @contexts ||= @contexts = {}
20
+ @contexts ||= {}
21
21
  end
22
22
 
23
23
  # Return an array of validators for a named context
24
24
  #
25
25
  # @return <Array> An array of validators
26
26
  def context(name)
27
- contexts[name] = [] unless contexts.has_key?(name)
28
- contexts[name]
27
+ contexts[name] ||= []
29
28
  end
30
29
 
31
30
  # Clear all named context validators off of the resource
@@ -6,7 +6,7 @@ module DataMapper
6
6
  # @author Guy van den Berg
7
7
  # @since 0.9
8
8
  class UniquenessValidator < GenericValidator
9
- include Assertions
9
+ include Extlib::Assertions
10
10
 
11
11
  def initialize(field_name, options = {})
12
12
  assert_kind_of 'scope', options[:scope], Array, Symbol if options.has_key?(:scope)
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  module Validations
3
- VERSION = '0.9.8'
3
+ VERSION = '0.9.9'
4
4
  end
5
5
  end
@@ -127,9 +127,9 @@ describe "Automatic Validation from Property Definition" do
127
127
  it "should not auto add any validators if the option :auto_validation => false was given" do
128
128
  klass = Class.new do
129
129
  include DataMapper::Resource
130
- property :id, Integer, :serial => true, :auto_validation => false
131
- property :name, String, :nullable => false, :auto_validation => false
132
- property :bool, DM::Boolean, :nullable => false, :auto_validation => false
130
+ property :id, Integer, :serial => true, :auto_validation => false
131
+ property :name, String, :nullable => false, :auto_validation => false
132
+ property :bool, DataMapper::Types::Boolean, :nullable => false, :auto_validation => false
133
133
  end
134
134
  klass.new.valid?.should == true
135
135
  end
@@ -5,7 +5,7 @@ class Monica # :nodoc:
5
5
  include DataMapper::Resource
6
6
  property :id, Integer, :serial => true
7
7
  property :birth_date, Date, :auto_validation => false
8
- property :happy, TrueClass
8
+ property :happy, Boolean
9
9
  validates_is_primitive :birth_date
10
10
  end
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guy van den Berg
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-07 00:00:00 -08:00
12
+ date: 2009-01-04 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.9.8
23
+ version: 0.9.9
24
24
  version:
25
25
  description: DataMapper plugin for performing validations on data models
26
26
  email: