public
Fork of eldiablo/feather-plugins
Description: This contains various plugins for Feather
Clone URL: git://github.com/ivey/feather-plugins.git
Search Repo:
Changed destroy! to destroy to be compatible with DM 0.9.1
mleung (author)
Wed Jun 11 11:08:04 -0700 2008
commit  019c87d0e432fa923e793b9a6e7faab7f338d6de
tree    cf17eed06ee4d323f5fe34356e58e39d1e24b1d3
parent  009f732c47aaa6e39c48d3872a569f523f3049b1
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @comment.destroy!
0
+ @comment.destroy
0
       expire_index
0
       expire_article(@comment.article)
0
       redirect url(:admin_comments)
...
37
38
39
40
 
41
42
43
...
37
38
39
 
40
41
42
43
0
@@ -37,7 +37,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @ping_service.destroy!
0
+ @ping_service.destroy
0
       redirect url(:admin_ping_services)
0
     end
0
 
...
37
38
39
40
 
41
42
43
...
37
38
39
 
40
41
42
43
0
@@ -37,7 +37,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @redirect.destroy!
0
+ @redirect.destroy
0
       redirect url(:admin_redirects)
0
     end
0
 
...
35
36
37
38
 
39
40
41
...
35
36
37
 
38
39
40
41
0
@@ -35,7 +35,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @release.destroy!
0
+ @release.destroy
0
       redirect url(:admin_releases)
0
     end
0
 
...
9
10
11
12
 
13
14
15
...
9
10
11
 
12
13
14
15
0
@@ -9,7 +9,7 @@
0
      new Form.Element.Observer('search-text', 1,
0
      function(element, value) {new Ajax.Updater(
0
      'search-results',
0
- 'http://<%= request.env['HTTP_HOST'] %>/search',
0
+ '/search',
0
      {asynchronous:true, evalScripts:true,
0
      onComplete:function(request)
0
      {Element.hide('search-spinner')},
...
37
38
39
40
 
41
42
43
...
37
38
39
 
40
41
42
43
0
@@ -37,7 +37,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @sidebar_group.destroy!
0
+ @sidebar_group.destroy
0
       expire_all_pages
0
       redirect url(:admin_sidebar_groups)
0
     end
...
37
38
39
40
 
41
42
43
...
37
38
39
 
40
41
42
43
0
@@ -37,7 +37,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @snippet.destroy!
0
+ @snippet.destroy
0
       expire_all_pages
0
       redirect url(:admin_snippets)
0
     end
...
37
38
39
40
 
41
42
43
...
37
38
39
 
40
41
42
43
0
@@ -37,7 +37,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @style.destroy!
0
+ @style.destroy
0
       expire_all_pages
0
       redirect url(:admin_styles)
0
     end
...
8
9
10
11
 
12
13
14
...
8
9
10
 
11
12
13
14
0
@@ -8,7 +8,7 @@ class Article
0
   def create_tags
0
     return if @tag_list.nil? || @tag_list.empty?
0
     # Wax all the existing taggings
0
- self.taggings.each {|t| t.destroy! }
0
+ self.taggings.each {|t| t.destroy }
0
     @tag_list.split(",").each do |t|
0
       unless t.empty?
0
         tag = Tag.find_or_create(:name => t.strip.downcase)
...
29
30
31
32
 
33
34
35
...
29
30
31
 
32
33
34
35
0
@@ -29,7 +29,7 @@ module Admin
0
     end
0
     
0
     def delete
0
- Theme.get(params[:id]).destroy!
0
+ Theme.get(params[:id]).destroy
0
       redirect url(:admin_themes)
0
     end
0
   end
...
18
19
20
21
 
22
23
24
...
18
19
20
 
21
22
23
24
0
@@ -18,7 +18,7 @@ class Theme
0
     name
0
   end
0
   
0
- def destroy!
0
+ def destroy
0
     FileUtils.rm_rf(path)
0
   end
0
   
...
9
10
11
12
 
13
14
15
...
9
10
11
 
12
13
14
15
0
@@ -9,7 +9,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @tweet.destroy!
0
+ @tweet.destroy
0
       expire_index
0
       redirect url(:admin_tweets)
0
     end
...
19
20
21
22
 
23
24
25
26
27
 
 
 
28
29
30
...
35
36
37
38
 
39
40
41
...
19
20
21
 
22
23
24
25
26
27
28
29
30
31
32
33
...
38
39
40
 
41
42
43
44
0
@@ -19,12 +19,15 @@ module Admin
0
       @upload.url = (@upload.url[0...1] == "/" ? @upload.url : "/#{@upload.url}")
0
       @upload.url = (@upload.url[0...6] == "/files" ? @upload.url : "/files#{@upload.url}")
0
       # Create the directory
0
- FileUtils.mkdir_p Merb.dir_for(:public) / File.dirname(@upload.url)
0
+ # FileUtils.mkdir_p Merb.dir_for(:public) / File.dirname(@upload.url)
0
       # If a file is present, set the size, content type, and then move the temporary file to the new uploads location
0
       unless params[:file].nil? || params[:file][:tempfile].nil?
0
         @upload.size = params[:file][:size]
0
         @upload.content_type = params[:file][:content_type]
0
         FileUtils.mv(params[:file][:tempfile].path, (Merb.dir_for(:public) / @upload.url))
0
+ unless File.chmod(0644, @upload.url) == 0
0
+ raise "Couldn't change permission on #{@upload_url}"
0
+ end
0
       end
0
       @upload.created_at = Time.now
0
       if @upload.save
0
@@ -35,7 +38,7 @@ module Admin
0
     end
0
 
0
     def delete
0
- @upload.destroy!
0
+ @upload.destroy
0
       # Delete the physical file
0
       File.delete(Merb.dir_for(:public) / @upload.url)
0
       redirect url(:admin_uploads)

Comments

    No one has commented yet.