lib/kentouzu/has_drafts.rb in kentouzu-0.2.1 vs lib/kentouzu/has_drafts.rb in kentouzu-0.2.2
- old
+ new
@@ -135,20 +135,20 @@
# Override the default `save` method and replace it with one that checks to see if a draft should be saved.
# If a draft should be saved the original object instance is left untouched and a new draft is created.
def self.included(base)
default_save = base.instance_method(:save)
- base.send :define_method, :save do
+ base.send :define_method, :save do |*|
if switched_on? && save_draft?
save_draft
else
default_save.bind(self).call
end
end
default_save_with_bang = base.instance_method(:save!)
- base.send :define_method, :save! do
+ base.send :define_method, :save! do |*|
if switched_on? && save_draft?
save_draft
else
default_save_with_bang.bind(self).call
end