Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

make style optional in copy_to_local_file #2028

Closed
wants to merge 1 commit into from

Conversation

kurtzur
Copy link

@kurtzur kurtzur commented Oct 19, 2015

I recently had to use copy_to_local_file and was frustrated by the fact that style was a required parameter. I had to dig into Attachment::default_options to realize that :original was what I needed to pass.
I changed copy_to_local_file so that the style falls back to default_style when not provided. This matches the behavior of existing methods like expiring_url and s3_object (in module S3).

@@ -446,10 +446,10 @@ def flush_deletes #:nodoc:
@queued_for_delete = []
end

def copy_to_local_file(style, local_dest_path)
def copy_to_local_file(local_dest_path, style_name = default_style)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to switch the order of parameters, can we leave them as they were? Thank you.

@tute
Copy link
Contributor

tute commented Aug 24, 2016

I'd rather have this method require the style and keep it explicit. If you think we can improve the documentation, or something else, please let me know. Thank you for sharing your work!

@tute tute closed this Aug 24, 2016
jywarren added a commit to publiclab/spectral-workbench that referenced this pull request Jan 25, 2022
jywarren added a commit to publiclab/spectral-workbench that referenced this pull request Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants