From b71ae86f9f590a738d552ba3836cc85941015987 Mon Sep 17 00:00:00 2001 From: Eslam Foad Date: Mon, 29 Jul 2013 14:25:22 +0200 Subject: [PATCH] fix bug of initial points added to the recognizable to be added after_create instead of after_save --- .gitignore | 1 + CHANGELOG.txt | 4 ++++ lib/recognition/extensions/active_record.rb | 4 ++-- lib/recognition/version.rb | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2cee9de..33ec879 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ spec/dummy/db/*.sqlite3 spec/dummy/log/*.log spec/dummy/tmp/ spec/dummy/.sass-cache +.project/ diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d03db22..2d06b75 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +Version 0.8.6: +-------------- +* Fixing the bug of initial points to the recognizable to be added after_create not after_save + Version 0.8.5: -------------- * Refactoring: Merging Railtie with Rails Engine. diff --git a/lib/recognition/extensions/active_record.rb b/lib/recognition/extensions/active_record.rb index 550a464..855bbfd 100644 --- a/lib/recognition/extensions/active_record.rb +++ b/lib/recognition/extensions/active_record.rb @@ -17,7 +17,7 @@ def acts_as_recognizable options = {} self.recognitions[:initial] = { amount: options[:initial] } - after_save :add_initial_points + after_create :add_initial_points end # to be called from other models @@ -81,4 +81,4 @@ def self.validates_gift_redmeption validators end end end -end \ No newline at end of file +end diff --git a/lib/recognition/version.rb b/lib/recognition/version.rb index ace7833..a1b48b4 100644 --- a/lib/recognition/version.rb +++ b/lib/recognition/version.rb @@ -1,4 +1,4 @@ module Recognition # Current Version - VERSION = "0.8.5" + VERSION = "0.8.6" end \ No newline at end of file