From 5232273a3752ec8983b3670a9119a73e0aa2a719 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 21 Oct 2015 10:33:48 -0400 Subject: [PATCH] Only set types during create --- app/models/card.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/card.rb b/app/models/card.rb index 8ffd81d..e50ddc9 100644 --- a/app/models/card.rb +++ b/app/models/card.rb @@ -1,7 +1,7 @@ class Card < ActiveRecord::Base has_paper_trail - before_save :set_stat_types + after_create :set_stat_types belongs_to :character belongs_to :rarity @@ -55,5 +55,7 @@ class Card < ActiveRecord::Base self.hp_stat.stat_type_id = 1 self.atk_stat.stat_type_id = 2 self.def_stat.stat_type_id = 3 + + self.save end end