light_mongo-rails 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -0
- data/VERSION +1 -1
- data/lib/model/active_model_compliance.rb +4 -0
- data/spec/model/active_model_compliance_spec.rb +14 -0
- metadata +5 -5
- data/README +0 -0
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
LightMongo-Rails
|
2
|
+
================
|
3
|
+
|
4
|
+
LightMongo-Rails provides ActionPack compatibility for [LightMongo][lm], allowing you to use form_for and other such helpers.
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
`gem install light_mongo-rails`, assuming you already have LightMongo and Rails 3 on the boil.
|
10
|
+
|
11
|
+
Usage
|
12
|
+
-----
|
13
|
+
|
14
|
+
class MyModel
|
15
|
+
include LightMongo::Model
|
16
|
+
end
|
17
|
+
|
18
|
+
Then use like a normal LightMongo::Document.
|
19
|
+
|
20
|
+
NB: You are still welcome to include LightMongo::Document when in Rails, you just might hit some trouble using the ActionPack helpers.
|
21
|
+
|
22
|
+
[lm]:http://github.com/elliotcm/light_mongo
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -11,6 +11,20 @@ describe ActiveModelCompliance do
|
|
11
11
|
@model = ActiveModelComplianceTest.new
|
12
12
|
end
|
13
13
|
|
14
|
+
describe "#to_param" do
|
15
|
+
before(:each) do
|
16
|
+
@model.instance_variable_set(:@_id,
|
17
|
+
mock(:oid,
|
18
|
+
:to_s => (@string_id = mock(:string_id))
|
19
|
+
)
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns the string form of the document id" do
|
24
|
+
@model.to_param.should == @string_id
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
14
28
|
describe "#valid?" do
|
15
29
|
it "responds to #valid?" do
|
16
30
|
@model.should respond_to(:valid?)
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Elliot Crosby-McCullough
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-28 00:00:00 +00:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -38,10 +38,10 @@ executables: []
|
|
38
38
|
extensions: []
|
39
39
|
|
40
40
|
extra_rdoc_files:
|
41
|
-
- README
|
41
|
+
- README.md
|
42
42
|
files:
|
43
43
|
- .gitignore
|
44
|
-
- README
|
44
|
+
- README.md
|
45
45
|
- Rakefile
|
46
46
|
- VERSION
|
47
47
|
- lib/light_mongo-rails.rb
|
data/README
DELETED
File without changes
|