datamapper-shim 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Gemfile.lock +12 -12
- data/datamapper-shim.gemspec +3 -3
- data/lib/data_mapper/shim.rb +1 -1
- data/test/data_mapper/shim_test.rb +10 -0
- metadata +23 -21
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YzVjNzhjZGE4YjcwY2RlYjI4MjY5M2MwMTk3MzgzMjBlYTJjZDZjYw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1bf69a61204014eab511cfeee3c830bb3c0281ed
|
4
|
+
data.tar.gz: 001ab4ad3e0936eb68587b0fee6e92c4794fd4fb
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NjljMWUzMmJkY2Q0NzkzYmMxYjBlMWIzYmZjYjAwMTBiYWViN2NjNmM1OGZh
|
11
|
-
ZDQ5NWJhM2E2ZjE5NmY0Y2RkZmM2Yjg4YjZkM2UyMDU3MWIyMjY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZDUzMjAxODNkYmFjOTU0ZjU1NzQzYjJmNmUxZGI4YTBjNWM0NDg2ODMzY2U4
|
14
|
-
N2Y0YWE2OTU4ZjlkZGFhNjYyYmQ2NDFlMTQxNGY2NmZlODc4MzhiMTBlMTYx
|
15
|
-
ZjE0ZDEyOWM4NDY0ZDA4ZDdkZGM4NjI2NjYxMTgxOTFhNDRhOWU=
|
6
|
+
metadata.gz: 46fd21e261778d3a0866912f913c41fd734ba10b18267824264baf153258bb20c469ecc551d89f1d5b685e320060e7986e9411e5715cee17b5d1aa92eafb5bb3
|
7
|
+
data.tar.gz: ae2d15bd7a47cab1c42a172440d5954f80e4fb3aa2673515c5fe986e9de22fe1d39695a447d4f7941b124ddb8626486d2b3198ca4b2e8567c2788d76524ce5f2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
datamapper-shim (0.0.
|
4
|
+
datamapper-shim (0.0.4)
|
5
5
|
activerecord (~> 3.2.0)
|
6
6
|
composite_primary_keys (~> 5.0.0)
|
7
7
|
json (~> 1.4)
|
@@ -9,27 +9,27 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (3.2.
|
13
|
-
activesupport (= 3.2.
|
12
|
+
activemodel (3.2.22)
|
13
|
+
activesupport (= 3.2.22)
|
14
14
|
builder (~> 3.0.0)
|
15
|
-
activerecord (3.2.
|
16
|
-
activemodel (= 3.2.
|
17
|
-
activesupport (= 3.2.
|
15
|
+
activerecord (3.2.22)
|
16
|
+
activemodel (= 3.2.22)
|
17
|
+
activesupport (= 3.2.22)
|
18
18
|
arel (~> 3.0.2)
|
19
19
|
tzinfo (~> 0.3.29)
|
20
|
-
activesupport (3.2.
|
20
|
+
activesupport (3.2.22)
|
21
21
|
i18n (~> 0.6, >= 0.6.4)
|
22
22
|
multi_json (~> 1.0)
|
23
23
|
arel (3.0.3)
|
24
24
|
builder (3.0.4)
|
25
25
|
coderay (1.1.0)
|
26
|
-
composite_primary_keys (5.0.
|
26
|
+
composite_primary_keys (5.0.14)
|
27
27
|
activerecord (~> 3.2.0, >= 3.2.9)
|
28
|
-
i18n (0.
|
29
|
-
json (1.8.
|
28
|
+
i18n (0.7.0)
|
29
|
+
json (1.8.3)
|
30
30
|
method_source (0.8.2)
|
31
31
|
minitest (5.2.3)
|
32
|
-
multi_json (1.
|
32
|
+
multi_json (1.11.1)
|
33
33
|
pry (0.9.12.4)
|
34
34
|
coderay (~> 1.0)
|
35
35
|
method_source (~> 0.8)
|
@@ -37,7 +37,7 @@ GEM
|
|
37
37
|
rake (10.1.1)
|
38
38
|
slop (3.4.7)
|
39
39
|
sqlite3 (1.3.8)
|
40
|
-
tzinfo (0.3.
|
40
|
+
tzinfo (0.3.44)
|
41
41
|
|
42
42
|
PLATFORMS
|
43
43
|
ruby
|
data/datamapper-shim.gemspec
CHANGED
@@ -4,9 +4,9 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "datamapper-shim"
|
7
|
-
spec.version = "0.0.
|
8
|
-
spec.authors = ["ecin"]
|
9
|
-
spec.email = ["ecin@copypastel.com"]
|
7
|
+
spec.version = "0.0.5"
|
8
|
+
spec.authors = ["ecin", "gblazer"]
|
9
|
+
spec.email = ["ecin@copypastel.com", "gblazer@gmail.com"]
|
10
10
|
spec.description = "Dress ActiveRecord models in DataMapper robes"
|
11
11
|
spec.summary = "Migrate DataMapper models to ActiveRecord"
|
12
12
|
spec.homepage = "https://github.com/typekit/datamapper-shim"
|
data/lib/data_mapper/shim.rb
CHANGED
@@ -217,7 +217,7 @@ module DataMapper
|
|
217
217
|
# Note, we don't define this on ActiveRecord::Relation
|
218
218
|
def self.where(opts, *rest)
|
219
219
|
@__datamapper_shim_enums.each do |name, enum|
|
220
|
-
if opts.has_key?(name) && !opts[name].is_a?(Integer)
|
220
|
+
if opts.is_a?(Hash) && opts.has_key?(name) && !opts[name].is_a?(Integer)
|
221
221
|
opts[name] = enum[opts[name]]
|
222
222
|
end
|
223
223
|
end
|
@@ -553,6 +553,16 @@ describe DataMapper::Shim do
|
|
553
553
|
Typecaster.first.enum.must_equal :active
|
554
554
|
end
|
555
555
|
|
556
|
+
it "can query using regular sql" do
|
557
|
+
@typecaster.enum = :pending
|
558
|
+
@typecaster.list = 'test'
|
559
|
+
@typecaster.save
|
560
|
+
|
561
|
+
Typecaster.where("enum = 1 AND list = 'test'").first.must_equal @typecaster
|
562
|
+
Typecaster.first.enum.must_equal :pending
|
563
|
+
Typecaster.first.list.first.must_equal "test"
|
564
|
+
end
|
565
|
+
|
556
566
|
it "can typecast booleans" do
|
557
567
|
@typecaster.boolean = 0
|
558
568
|
@typecaster.boolean.must_equal false
|
metadata
CHANGED
@@ -1,130 +1,132 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datamapper-shim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ecin
|
8
|
+
- gblazer
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: json
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - ~>
|
18
|
+
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
20
|
version: '1.4'
|
20
21
|
type: :runtime
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- - ~>
|
25
|
+
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
27
|
version: '1.4'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: activerecord
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
|
-
- - ~>
|
32
|
+
- - "~>"
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: 3.2.0
|
34
35
|
type: :runtime
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- - ~>
|
39
|
+
- - "~>"
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: 3.2.0
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
43
|
name: composite_primary_keys
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
|
-
- - ~>
|
46
|
+
- - "~>"
|
46
47
|
- !ruby/object:Gem::Version
|
47
48
|
version: 5.0.0
|
48
49
|
type: :runtime
|
49
50
|
prerelease: false
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
|
-
- - ~>
|
53
|
+
- - "~>"
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: 5.0.0
|
55
56
|
- !ruby/object:Gem::Dependency
|
56
57
|
name: rake
|
57
58
|
requirement: !ruby/object:Gem::Requirement
|
58
59
|
requirements:
|
59
|
-
- - ~>
|
60
|
+
- - "~>"
|
60
61
|
- !ruby/object:Gem::Version
|
61
62
|
version: 10.1.1
|
62
63
|
type: :development
|
63
64
|
prerelease: false
|
64
65
|
version_requirements: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- - ~>
|
67
|
+
- - "~>"
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: 10.1.1
|
69
70
|
- !ruby/object:Gem::Dependency
|
70
71
|
name: sqlite3
|
71
72
|
requirement: !ruby/object:Gem::Requirement
|
72
73
|
requirements:
|
73
|
-
- - ~>
|
74
|
+
- - "~>"
|
74
75
|
- !ruby/object:Gem::Version
|
75
76
|
version: 1.3.8
|
76
77
|
type: :development
|
77
78
|
prerelease: false
|
78
79
|
version_requirements: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
|
-
- - ~>
|
81
|
+
- - "~>"
|
81
82
|
- !ruby/object:Gem::Version
|
82
83
|
version: 1.3.8
|
83
84
|
- !ruby/object:Gem::Dependency
|
84
85
|
name: bundler
|
85
86
|
requirement: !ruby/object:Gem::Requirement
|
86
87
|
requirements:
|
87
|
-
- - ~>
|
88
|
+
- - "~>"
|
88
89
|
- !ruby/object:Gem::Version
|
89
90
|
version: '1.3'
|
90
91
|
type: :development
|
91
92
|
prerelease: false
|
92
93
|
version_requirements: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
|
-
- - ~>
|
95
|
+
- - "~>"
|
95
96
|
- !ruby/object:Gem::Version
|
96
97
|
version: '1.3'
|
97
98
|
- !ruby/object:Gem::Dependency
|
98
99
|
name: minitest
|
99
100
|
requirement: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- - ~>
|
102
|
+
- - "~>"
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: 5.2.3
|
104
105
|
type: :development
|
105
106
|
prerelease: false
|
106
107
|
version_requirements: !ruby/object:Gem::Requirement
|
107
108
|
requirements:
|
108
|
-
- - ~>
|
109
|
+
- - "~>"
|
109
110
|
- !ruby/object:Gem::Version
|
110
111
|
version: 5.2.3
|
111
112
|
- !ruby/object:Gem::Dependency
|
112
113
|
name: pry
|
113
114
|
requirement: !ruby/object:Gem::Requirement
|
114
115
|
requirements:
|
115
|
-
- - ~>
|
116
|
+
- - "~>"
|
116
117
|
- !ruby/object:Gem::Version
|
117
118
|
version: 0.9.12.4
|
118
119
|
type: :development
|
119
120
|
prerelease: false
|
120
121
|
version_requirements: !ruby/object:Gem::Requirement
|
121
122
|
requirements:
|
122
|
-
- - ~>
|
123
|
+
- - "~>"
|
123
124
|
- !ruby/object:Gem::Version
|
124
125
|
version: 0.9.12.4
|
125
126
|
description: Dress ActiveRecord models in DataMapper robes
|
126
127
|
email:
|
127
128
|
- ecin@copypastel.com
|
129
|
+
- gblazer@gmail.com
|
128
130
|
executables: []
|
129
131
|
extensions: []
|
130
132
|
extra_rdoc_files: []
|
@@ -145,17 +147,17 @@ require_paths:
|
|
145
147
|
- lib
|
146
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
147
149
|
requirements:
|
148
|
-
- -
|
150
|
+
- - ">="
|
149
151
|
- !ruby/object:Gem::Version
|
150
152
|
version: '0'
|
151
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
154
|
requirements:
|
153
|
-
- -
|
155
|
+
- - ">="
|
154
156
|
- !ruby/object:Gem::Version
|
155
157
|
version: '0'
|
156
158
|
requirements: []
|
157
159
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.2.2
|
159
161
|
signing_key:
|
160
162
|
specification_version: 4
|
161
163
|
summary: Migrate DataMapper models to ActiveRecord
|