dm-constraints 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
data/lib/dm-constraints.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'pathname'
|
4
4
|
|
5
5
|
# Add all external dependencies for the plugin here
|
6
|
-
gem 'dm-core', '
|
6
|
+
gem 'dm-core', '~>0.9.7'
|
7
7
|
require 'dm-core'
|
8
8
|
|
9
9
|
# Require plugin-files
|
@@ -18,10 +18,6 @@ module DataMapper
|
|
18
18
|
end
|
19
19
|
|
20
20
|
module Adapters
|
21
|
-
class DataObjectsAdapter
|
22
|
-
include DataMapper::Constraints::DataObjectsAdapter::SQL
|
23
|
-
end
|
24
|
-
|
25
21
|
class MysqlAdapter
|
26
22
|
include DataMapper::Constraints::MysqlAdapter::SQL
|
27
23
|
end
|
@@ -5,43 +5,40 @@ require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
|
|
5
5
|
|
6
6
|
describe 'DataMapper::Constraints' do
|
7
7
|
|
8
|
-
before
|
8
|
+
before do
|
9
9
|
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[adapter]
|
10
10
|
|
11
11
|
class Stable
|
12
12
|
include DataMapper::Resource
|
13
13
|
|
14
|
-
property :id,
|
15
|
-
property :location,
|
16
|
-
property :size,
|
14
|
+
property :id, Serial
|
15
|
+
property :location, String
|
16
|
+
property :size, Integer
|
17
|
+
|
18
|
+
has n, :cows
|
17
19
|
end
|
18
20
|
|
19
21
|
class Farmer
|
20
22
|
include DataMapper::Resource
|
21
23
|
|
22
24
|
property :first_name, String, :key => true
|
23
|
-
property :last_name,
|
25
|
+
property :last_name, String, :key => true
|
26
|
+
|
27
|
+
has n, :cows
|
24
28
|
end
|
25
29
|
|
26
30
|
class Cow
|
27
31
|
include DataMapper::Resource
|
28
32
|
include DataMapper::Constraints
|
29
33
|
|
30
|
-
property :id,
|
31
|
-
property :name,
|
32
|
-
property :breed,
|
34
|
+
property :id, Serial
|
35
|
+
property :name, String
|
36
|
+
property :breed, String
|
37
|
+
|
33
38
|
belongs_to :stable
|
34
39
|
belongs_to :farmer
|
35
40
|
end
|
36
41
|
|
37
|
-
class Stable
|
38
|
-
has n, :cows
|
39
|
-
end
|
40
|
-
|
41
|
-
class Farmer
|
42
|
-
has n, :cows
|
43
|
-
end
|
44
|
-
|
45
42
|
DataMapper.auto_migrate!
|
46
43
|
end
|
47
44
|
|
data/spec/spec_helper.rb
CHANGED
@@ -3,14 +3,14 @@ gem 'rspec', '>=1.1.3'
|
|
3
3
|
require 'spec'
|
4
4
|
require 'pathname'
|
5
5
|
|
6
|
-
gem 'dm-core', '
|
6
|
+
gem 'dm-core', '~>0.9.7'
|
7
7
|
require 'dm-core'
|
8
8
|
|
9
9
|
def load_driver(name, default_uri)
|
10
10
|
|
11
11
|
lib = "do_#{name}"
|
12
12
|
begin
|
13
|
-
gem lib, '
|
13
|
+
gem lib, '~>0.9.7'
|
14
14
|
require lib
|
15
15
|
DataMapper.setup(name, ENV["#{name.to_s.upcase}_SPEC_URI"] || default_uri)
|
16
16
|
DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-constraints
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dirkjan Bussink
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-18 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.
|
23
|
+
version: 0.9.7
|
24
24
|
version:
|
25
25
|
description: DataMapper plugin for performing validations on data models
|
26
26
|
email:
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
requirements: []
|
78
78
|
|
79
79
|
rubyforge_project: datamapper
|
80
|
-
rubygems_version: 1.
|
80
|
+
rubygems_version: 1.3.1
|
81
81
|
signing_key:
|
82
82
|
specification_version: 2
|
83
83
|
summary: DataMapper plugin for performing validations on data models
|