couch_potato-rails2 0.5.9 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/couch_potato/persistence/callbacks.rb +10 -10
- data/lib/couch_potato/version.rb +1 -1
- metadata +1 -1
@@ -3,22 +3,22 @@ module CouchPotato
|
|
3
3
|
module Callbacks
|
4
4
|
def self.included(base) #:nodoc:
|
5
5
|
|
6
|
-
base.class_eval do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
6
|
+
# base.class_eval do
|
7
|
+
# attr_accessor :skip_callbacks
|
8
|
+
#
|
9
|
+
# define_model_callbacks :create, :save, :update, :destroy
|
10
|
+
# define_model_callbacks *[:save, :create, :update].map {|c| :"validation_on_#{c}"}
|
11
|
+
# define_model_callbacks :validation
|
12
|
+
# end
|
13
13
|
end
|
14
14
|
|
15
15
|
# Runs all callbacks on a model with the given name, e.g. :after_create.
|
16
16
|
#
|
17
17
|
# This method is called by the CouchPotato::Database object when saving/destroying an object
|
18
18
|
def run_callbacks(name, &block)
|
19
|
-
return if skip_callbacks
|
20
|
-
|
21
|
-
send(:"_run_#{name}_callbacks", &block)
|
19
|
+
# return if skip_callbacks
|
20
|
+
#
|
21
|
+
# send(:"_run_#{name}_callbacks", &block)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/couch_potato/version.rb
CHANGED