Skip to content

Instantly share code, notes, and snippets.

@aya-soft
Created May 28, 2016 16:46
Show Gist options
  • Save aya-soft/3f5cb79961c330fb7524d0224dc6d424 to your computer and use it in GitHub Desktop.
Save aya-soft/3f5cb79961c330fb7524d0224dc6d424 to your computer and use it in GitHub Desktop.
Попахивающий кусок кода: на лицо дублирование и неправильное распределение обязанностей между объектами
def spare_ratio_link(spare, url)
if SpareComment.has_comments?(spare)
link_to (rating_stars_row(average_ratio(spare)).html_safe + sum_ratios(spare).to_s), url
else
link_to (rating_stars_row(average_ratio(spare)).html_safe + sum_ratios(spare).to_s), ''
end
end
@romhi
Copy link

romhi commented May 31, 2016

Сделал в ветке revision_1468

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment