lib/bulldog/attachment/maybe.rb in bulldog-0.2.0 vs lib/bulldog/attachment/maybe.rb in bulldog-0.2.1
- old
+ new
@@ -150,11 +150,15 @@
# assigned to the attachment (e.g., :extension).
#
def interpolate_path(style_name, params={})
template = reflection.path_template
style = reflection.styles[style_name]
- Interpolation.interpolate(template, record, name, style, params)
+ if template.is_a?(Symbol)
+ record.send(template, name, style)
+ else
+ Interpolation.interpolate(template, record, name, style, params)
+ end
end
#
# Return the URL that the given style would be found at.
#
@@ -164,10 +168,14 @@
# to the attachment (e.g., :extension).
#
def interpolate_url(style_name, params={})
template = reflection.url_template
style = reflection.styles[style_name]
- Interpolation.interpolate(template, record, name, style, params)
+ if template.is_a?(Symbol)
+ record.send(template, name, style)
+ else
+ Interpolation.interpolate(template, record, name, style, params)
+ end
end
protected # ---------------------------------------------------
#