Skip to content

Commit ecfbfe8

Browse files
committed
Merge pull request #1706 from resolve/override-page-rebuild
Replaces #1702
2 parents a9ae83a + 9adbd71 commit ecfbfe8

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Diff for: pages/app/models/refinery/page.rb

+6
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ def expire_page_caching
186186
return true # so that other callbacks process.
187187
end
188188
end
189+
190+
def rebuild_with_invalidate_cached_urls!
191+
rebuild_without_invalidate_cached_urls!
192+
find_each { |page| page.send :invalidate_cached_urls }
193+
end
194+
alias_method_chain :rebuild!, :invalidate_cached_urls
189195
end
190196

191197
# The canonical page for this particular page.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require "spec_helper"
2+
3+
module Refinery
4+
module Admin
5+
describe PagesController, :focus => true do
6+
login_refinery_superuser
7+
8+
describe "#update_positions" do
9+
it "calls .rebuild! on Refinery::Page" do
10+
Refinery::Page.should_receive(:rebuild!).once
11+
12+
post :update_positions, :ul => []
13+
end
14+
end
15+
end
16+
end
17+
end

0 commit comments

Comments
 (0)