Skip to content

Commit

Permalink
[Refactor] Remove unneeded methods
Browse files Browse the repository at this point in the history
* Remove the Cms::Attachment#full_file_location method
  • Loading branch information
peakpg committed May 16, 2012
1 parent 0f5144b commit 5c6a6b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions app/models/cms/attachment.rb
Expand Up @@ -188,8 +188,6 @@ def path(style_name = configuration.default_style)
data.path(style_name)
end

alias :full_file_location :path

def original_filename
data_file_name
end
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/environments/production.rb
Expand Up @@ -11,7 +11,7 @@
config.action_controller.perform_caching = true

# Allows the CMS to use a single domain (with no caching or redirects).
config.cms.use_single_domain = false
config.cms.use_single_domain = true

# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
Expand Down
6 changes: 3 additions & 3 deletions test/unit/behaviors/attaching_test.rb
Expand Up @@ -474,7 +474,7 @@ def test_updating_the_attachment_file_name
@attachable.attachments[0].data = @file
@attachable.save!

assert_equal file_contents(@file.path), file_contents(@attachable.attachments[0].full_file_location)
assert_equal file_contents(@file.path), file_contents(@attachable.attachments[0].path)
end
end

Expand Down Expand Up @@ -553,8 +553,8 @@ def setup
test "Keep older versions of files" do
file2 = update_file_for_attachable

assert_equal file_contents(@file.path), file_contents(@attachable.as_of_version(1).attachments[0].full_file_location), "The contents of version 1 of the file should be returned"
assert_equal file_contents(file2.path), file_contents(@attachable.as_of_version(2).attachments[0].full_file_location)
assert_equal file_contents(@file.path), file_contents(@attachable.as_of_version(1).attachments[0].path), "The contents of version 1 of the file should be returned"
assert_equal file_contents(file2.path), file_contents(@attachable.as_of_version(2).attachments[0].path)
end

test "Deleting an attachment does not increment the version # of the block" do
Expand Down

0 comments on commit 5c6a6b7

Please sign in to comment.