From 1c2f36fb7e7bcd55deb25d1d81c045376d61cd60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20B=C3=B6ttger?= Date: Sat, 1 Mar 2014 15:35:20 +0100 Subject: [PATCH] bugfix: don't require ActiveRecord for localizing AASM event and state name #113 --- CHANGELOG.md | 4 ++++ lib/aasm/localizer.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac776fb..7464f54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ * deprecated old aasm_* class methods (old-style DSL), in preparation for AASM v4.0.0 +## 3.1.1 + + * bugfix: don't require ActiveRecord for localizing AASM event and state name (see [issue #113](https://github.com/aasm/aasm/issues/113), thanks to [@silentshade](https://github.com/silentshade)) + ## 3.1.0 * validating the current state (see [issue #95](https://github.com/aasm/aasm/issues/95), thanks to [@ivantsepp](https://github.com/ivantsepp)) diff --git a/lib/aasm/localizer.rb b/lib/aasm/localizer.rb index 0a750a6..5bc44fa 100644 --- a/lib/aasm/localizer.rb +++ b/lib/aasm/localizer.rb @@ -47,7 +47,7 @@ module AASM def ancestors_list(klass) klass.ancestors.select do |ancestor| - ancestor.respond_to?(:model_name) unless ancestor == ActiveRecord::Base + ancestor.respond_to?(:model_name) unless ancestor.name == 'ActiveRecord::Base' end end end