Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.2.0.z.beta
-
Fix Version/s: None
-
Component/s: None
-
Security Level: Public
-
Labels:None
-
Environment:Mac OS 10.8.1
ruby 1.9.3p194
Rails 3.2.8
Description
When using 'save' on an existing and previously saved document, there's a 'undefined method'-error on 'default'. 'save' and 'update' result in the same error.
class TestDoc < Couchbase::Model
attribute :email, :default => ''
attribute :created_at, :default => lambda { Time.zone.now }
view :by_created_at
end
t = TestDoc.new(:id => request.session_options[:id])
t.save
t = TestDoc.find(request.session_options[:id])
t.email = 'hello'
t.update(:email => 'blubb')
undefined method `default' for TestDoc(id, email, created_at):Class
couchbase-model (0.4.0) lib/couchbase/model.rb:487:in `save'
(eval):4:in `block in save'
activesupport (3.2.8) lib/active_support/callbacks.rb:403:in `_run__3218406879367123135__save__4511417429032474671__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
(eval):3:in `save'
couchbase-model (0.4.0) lib/couchbase/model.rb:501:in `update'
(eval):4:in `block in update'
activesupport (3.2.8) lib/active_support/callbacks.rb:403:in `_run__3218406879367123135__update__4511417429032474671__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_update_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
(eval):3:in `update'
class TestDoc < Couchbase::Model
attribute :email, :default => ''
attribute :created_at, :default => lambda { Time.zone.now }
view :by_created_at
end
t = TestDoc.new(:id => request.session_options[:id])
t.save
t = TestDoc.find(request.session_options[:id])
t.email = 'hello'
t.update(:email => 'blubb')
undefined method `default' for TestDoc(id, email, created_at):Class
couchbase-model (0.4.0) lib/couchbase/model.rb:487:in `save'
(eval):4:in `block in save'
activesupport (3.2.8) lib/active_support/callbacks.rb:403:in `_run__3218406879367123135__save__4511417429032474671__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
(eval):3:in `save'
couchbase-model (0.4.0) lib/couchbase/model.rb:501:in `update'
(eval):4:in `block in update'
activesupport (3.2.8) lib/active_support/callbacks.rb:403:in `_run__3218406879367123135__update__4511417429032474671__callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_update_callbacks'
activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
(eval):3:in `update'
Activity
Sergey Avseyev
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Sergey Avseyev
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |