lib/kentouzu/has_drafts.rb in kentouzu-0.2.0 vs lib/kentouzu/has_drafts.rb in kentouzu-0.2.1

- old
+ new

@@ -230,13 +230,13 @@ :source_type => Kentouzu.source.present? ? Kentouzu.source.class.to_s : nil, :source_id => Kentouzu.source.present? ? Kentouzu.source.id : nil, :object => self.as_json(include: self.class.reflect_on_all_associations(:has_many).map { |a| a.name }.reject { |a| a == :drafts }).to_yaml } - draft = Draft.new(merge_metadata(data)) + @draft = Draft.new(merge_metadata(data)) run_callbacks :draft_save do - draft.save + @draft.save end end def draft_event @draft_event ||= self.persisted? ? :update : :create