Deprecation warning for counter_caching?
This commit is contained in:
parent
4c2c09ca69
commit
f59f897d25
|
@ -17,6 +17,11 @@ module Impressionist
|
|||
def impressionist_counter_caching?
|
||||
impressionist_counter_cache_options.present?
|
||||
end
|
||||
|
||||
def counter_caching?
|
||||
::ActiveSupport::Deprecation.warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead")
|
||||
impressionist_counter_caching?
|
||||
end
|
||||
end
|
||||
|
||||
def impressionable?
|
||||
|
|
|
@ -18,6 +18,19 @@ describe Impression do
|
|||
end
|
||||
end
|
||||
|
||||
describe "self#counter_caching?" do
|
||||
it "should know when counter caching is enabled" do
|
||||
ActiveSupport::Deprecation.should_receive(:warn)
|
||||
Widget.should be_counter_caching
|
||||
end
|
||||
|
||||
it "should know when counter caching is enabled" do
|
||||
ActiveSupport::Deprecation.should_receive(:warn)
|
||||
Article.should_not be_counter_caching
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "#update_impressionist_counter_cache" do
|
||||
it "should update the counter cache column to reflect the correct number of impressions" do
|
||||
lambda {
|
||||
|
|
Loading…
Reference in New Issue