couchbase-model 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.markdown +7 -0
- data/README.markdown +20 -0
- data/couchbase-model.gemspec +1 -1
- data/lib/couchbase/model.rb +1 -1
- data/lib/couchbase/model/version.rb +1 -1
- metadata +3 -3
data/HISTORY.markdown
CHANGED
data/README.markdown
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
This library allows to declare models for [couchbase gem][1].
|
4
4
|
|
5
|
+
## SUPPORT
|
6
|
+
|
7
|
+
If you found an issue, please file it in our [JIRA][3]. Also you are
|
8
|
+
always welcome on `#libcouchbase` channel at [freenode.net IRC servers][4].
|
9
|
+
|
10
|
+
Documentation: [http://rdoc.info/gems/couchbase-model](http://rdoc.info/gems/couchbase-model)
|
11
|
+
|
5
12
|
## Rails integration
|
6
13
|
|
7
14
|
To generate config you can use `rails generate couchbase:config`:
|
@@ -83,6 +90,17 @@ You can define connection options on per model basis:
|
|
83
90
|
connect :port => 80, :bucket => 'blog'
|
84
91
|
end
|
85
92
|
|
93
|
+
## Validations
|
94
|
+
|
95
|
+
There are all methods from ActiveModel::Validations accessible in
|
96
|
+
context of rails application:
|
97
|
+
|
98
|
+
class Comment < Couchbase::Model
|
99
|
+
attribute :author, :body
|
100
|
+
|
101
|
+
validates_presence_of :author, :body
|
102
|
+
end
|
103
|
+
|
86
104
|
## Views (aka Map/Reduce indexes)
|
87
105
|
|
88
106
|
Views are stored in models directory in subdirectory named after the
|
@@ -138,3 +156,5 @@ And request them later:
|
|
138
156
|
|
139
157
|
[1]: https://github.com/couchbase/couchbase-ruby-client/
|
140
158
|
[2]: https://github.com/couchbaselabs/ruby-couchbase-model/tree/master/lib/rails/generators/couchbase/view/templates/
|
159
|
+
[3]: http://couchbase.com/issues/browse/RCBC
|
160
|
+
[4]: http://freenode.net/irc_servers.shtml
|
data/couchbase-model.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Couchbase::Model::VERSION
|
8
8
|
s.author = "Couchbase"
|
9
9
|
s.email = "support@couchbase.com"
|
10
|
-
s.homepage = "https://github.com/
|
10
|
+
s.homepage = "https://github.com/couchbase/couchbase-ruby-model"
|
11
11
|
s.summary = %q{Declarative interface to Couchbase}
|
12
12
|
s.description = %q{ORM-like interface allows you to persist your models to Couchbase}
|
13
13
|
|
data/lib/couchbase/model.rb
CHANGED
@@ -484,7 +484,7 @@ module Couchbase
|
|
484
484
|
end
|
485
485
|
return create unless meta
|
486
486
|
value = @_raw ? @_raw : attributes_with_values
|
487
|
-
model.bucket.replace(@id, value, model.
|
487
|
+
model.bucket.replace(@id, value, model.defaults.merge(:cas => cas))
|
488
488
|
self
|
489
489
|
end
|
490
490
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase-model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: couchbase
|
@@ -143,7 +143,7 @@ files:
|
|
143
143
|
- test/setup.rb
|
144
144
|
- test/test_model.rb
|
145
145
|
- test/test_uuid.rb
|
146
|
-
homepage: https://github.com/
|
146
|
+
homepage: https://github.com/couchbase/couchbase-ruby-model
|
147
147
|
licenses: []
|
148
148
|
post_install_message:
|
149
149
|
rdoc_options: []
|