orm_adapter-sequel 0.0.2 → 0.0.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.
- data/History.txt +5 -0
- data/lib/orm_adapter-sequel/sequel.rb +3 -0
- data/lib/orm_adapter-sequel/version.rb +1 -1
- data/spec/sequel_spec.rb +10 -1
- metadata +4 -4
data/History.txt
CHANGED
@@ -106,6 +106,9 @@ class Sequel::Model
|
|
106
106
|
|
107
107
|
def conditions_to_hash(conditions)
|
108
108
|
conditions.inject({}) do |cond_hash, (col, value)|
|
109
|
+
# make sure the key is a symbol
|
110
|
+
col = col.to_sym
|
111
|
+
|
109
112
|
if value.is_a?(Sequel::Model)
|
110
113
|
# look up the column name for the assoc
|
111
114
|
key = klass.association_reflection(col)[:key]
|
data/spec/sequel_spec.rb
CHANGED
@@ -44,6 +44,15 @@ else
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
describe "OrmAdapter instance" do
|
48
|
+
subject { User.to_adapter }
|
49
|
+
|
50
|
+
specify "#find_first should allow conditon keys to be strings" do
|
51
|
+
u = User.create(:name => 'test*', :rating => 1)
|
52
|
+
subject.find_first(:conditions => { 'name' => 'test*' }).should == u
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
47
56
|
it_should_behave_like "example app with orm_adapter" do
|
48
57
|
let(:user_class) { User }
|
49
58
|
let(:note_class) { Note }
|
@@ -60,4 +69,4 @@ else
|
|
60
69
|
end
|
61
70
|
end
|
62
71
|
|
63
|
-
end # if !defined?(Sequel)
|
72
|
+
end # if !defined?(Sequel)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orm_adapter-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Don Morrison
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-28 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|