lib/active_remote/persistence.rb in active_remote-1.3.1 vs lib/active_remote/persistence.rb in active_remote-1.3.2
- old
+ new
@@ -6,10 +6,19 @@
klass.class_eval do
extend ActiveRemote::Persistence::ClassMethods
include ActiveRemote::Persistence::InstanceMethods
include ActiveRemote::RPC
+ # Allow users to create callbacks around a `save` call.
+ #
define_model_callbacks :save
+
+ # Before a save occurs, ensure that we
+ # clear out the errors list.
+ #
+ set_callback :save, :before do |remote|
+ remote.errors.clear
+ end
end
end
##
# Class methods