charlotte-ruby/impressionist — pull request #71 by yous (2013-03-31 19:27:15+00:00)
Title: Fix uniqueness of impressionable_type

Changed generating impressionable_type by from controller_name to controller_path for namespaced controllers.

For Foo::Bar controller, when we impressionist(@foo_bar, nil, unique: [:impressionable_type, :impressionable_id, :user_id] then actual SQL statement is

SELECT 1 AS one FROM "impressions" WHERE "impressions"."impressionable_id" = 1 AND "impressions"."impressionable_type" = 'Foo::Bar' AND (("impressions"."impressionable_type" = 'Bar' AND "impressions"."impressionable_id" = 1 AND "impressions"."user_id" = 1)) LIMIT 1

So impressions_count is always increasing, but it is not we supposed to.