Created
April 29, 2011 23:55
-
-
Save kirkconnell/949255 to your computer and use it in GitHub Desktop.
Get content_ui for log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#return an array of arrays for the act event logger track changes in content_ui fields | |
# [ profile content real name, "displayed field name: displayed field value"] | |
def content_x_log_array | |
content_ui_log_instructions = (1..20).map {|n| ["content_#{n}", lambda{|value| "#{get_display_name(n)} : #{value}" }} | |
end | |
def get_display_name(n) | |
if template_group.present? && ci = template_group.content_uis.find_by_generic_field_number(n) | |
ci.field_name.titleize.gsub(/\s+/, '').underscore.to_sym | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment