mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
story#115762063 - use special helper method to generate class name
This commit is contained in:
parent
306819eeaf
commit
bcc8e7b6f8
5 changed files with 59 additions and 33 deletions
|
@ -72,4 +72,15 @@ module ApplicationHelper
|
|||
|
||||
link_to(title, url_for(sort: {param_name => order}), class: "sort_link #{order}")
|
||||
end
|
||||
|
||||
def changing_css_class(version, *attrs)
|
||||
return unless version
|
||||
css_class = "text-warning"
|
||||
|
||||
if attrs.size == 1
|
||||
version.object_changes.to_h[attrs.first] && css_class
|
||||
else
|
||||
version.object_changes.to_h.slice(*attrs).any? && css_class
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue