Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass #url args to #default_url #1347

Merged
merged 1 commit into from
Jun 2, 2014

Conversation

shekibobo
Copy link
Contributor

This will give us a few extra pieces to work with to name
a certain thumbnail for something. For instance:

def default_url(*args)
  vname = version_name || (args.first if versions.key?(args.first))
  [model.mounted_as.to_s, vname.to_s, "default.png"].join("_")
end

This will allow us to call model.attachment.url(:not_a_version) and still
return "attachment_not_a_version_default.png", which is useful in cases of
conditional versioning.

This will give us a few extra pieces to work with to name
a certain thumbnail for something. For instance:

```ruby
def default_url(*args)
  vname = version_name || args.first
  [model.mounted_as.to_s, vname, "default"].join("_")
end
```

This will allow us to call `model.attachment.url(:not_a_version)` and still
return "attachment_not_a_version_default", which is useful in cases of
conditional versioning.
@shekibobo shekibobo changed the title Pass #url args to #default_url Pass #url args to #default_url Mar 19, 2014
bensie added a commit that referenced this pull request Jun 2, 2014
@bensie bensie merged commit 6a816c1 into carrierwaveuploader:master Jun 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants