@@ -134,7 +134,7 @@ Usage
134
134
# article.save_queue.save
135
135
# article.save
136
136
137
- 1 . To save object _ only_ if it was changed, include Dirty module described below.
137
+ 1 . To save object _ only_ if it was changed, include Dirty module described below in plugins section .
138
138
139
139
1 . Continue reading for more details.
140
140
@@ -170,7 +170,7 @@ Queue is not cleared after fail. Possible to fix errors and rerun queue.save
170
170
171
171
Plugins
172
172
-------
173
- Any extract any "extra" functionality goes into bundled plugins.
173
+ Any "extra" functionality goes into bundled plugins.
174
174
175
175
### Dirty
176
176
@@ -195,8 +195,8 @@ In order to use it include this module and call #mark_as_changed method in mutat
195
195
end
196
196
197
197
To mark object as saved, call #mark_as_saved method. SaveQueue Dirty plugin will automatically call
198
- \# mark_as_saved method after saving an object.
199
- This marks are used when SaveQueue calls #save. Object will be saved only, if it #has_unsaved_changes? method returns true.
198
+ \# mark_as_saved method after saving an object. This marks are used when SaveQueue calls #save.
199
+ Object will be saved only, if it #has_unsaved_changes? method returns true.
200
200
There are some docs from spec tests:
201
201
202
202
#has_unsaved_changes?
@@ -224,7 +224,7 @@ If you have custom logic for marking objects dirty then you may want to overwrit
224
224
225
225
To use validation include SaveQueue::Plugins::Validation and implement #valid? method.
226
226
Failed objects are stored in save_queue.errors\[ : validation ] array.
227
- \ save_queue.errors are empty if no errors occurs
227
+ save_queue.errors are empty if no errors occurs
228
228
229
229
require 'save_queue'
230
230
require 'save_queue/plugins/validation'
@@ -298,7 +298,7 @@ Plugin adds SaveQueue::FailedValidationError:
298
298
299
299
# Note: queue was not saved. You dont need to do a cleanup
300
300
unless article.save then
301
- failed_objects = article.errors[:validation]
301
+ failed_objects = article.save_queue. errors[:validation]
302
302
end
303
303
304
304
begin
0 commit comments