Skip to content
This repository
tree: 7116f14b9e
Fetching contributors…

Cannot retrieve contributors at this time

file 34 lines (29 sloc) 0.827 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>class ${1:Model}Sweeper < ActionController::Caching::Sweeper
  observe ${1:Model}

  def after_save(${1/./\l$0/})
    expire_cache(${1/./\l$0/})
  end

  def after_destroy(${1/./\l$0/})
    expire_cache(${1/./\l$0/})
  end

  private

    def expire_cache(${1/./\l$0/})
      ${0:expire_page ${1/./\l$0/}s_path
      expire_page ${1/./\l$0/}_path(${1/./\l$0/})}
    end

end</string>
<key>name</key>
<string>Create sweeper class</string>
<key>scope</key>
<string>source.ruby</string>
<key>tabTrigger</key>
<string>sweeper</string>
<key>uuid</key>
<string>FF022038-CA5D-4045-909E-BF509343A5C7</string>
</dict>
</plist>
Something went wrong with that request. Please try again.