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 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
1
+ 0.1.0
@@ -14,6 +14,10 @@ module LightMongo
14
14
  module Model
15
15
 
16
16
  module ActiveModelCompliance
17
+ def to_param
18
+ @_id.to_s
19
+ end
20
+
17
21
  # Replace this with your own validations.
18
22
  def valid?
19
23
  true
@@ -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
- version: 0.0.1
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-27 00:00:00 +00:00
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