orm_adapter-sequel 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.0.3 (2011-05-28)
2
+
3
+ * Allow condition keys to be strings (for Devise compat.)
4
+ Pull request by mooman [https://github.com/mooman]
5
+
1
6
  == 0.0.2 (2011-01-14)
2
7
 
3
8
  * Use Sequel Subclasses plugin to track descendents
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module OrmAdapterSequel
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
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-01-14 00:00:00 -08:00
18
+ date: 2011-05-28 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency