updates from Production

This commit is contained in:
Lee Lawlor
2014-10-09 13:25:48 -04:00
parent edd3644654
commit 8e96629609
18 changed files with 81 additions and 21 deletions

View File

@ -90,6 +90,11 @@ class Channel < ActiveRecord::Base
cattr_reader :per_page
@@per_page = 15
# replace channel values: %%channel_1417_field_1%% is replaced with appropriate value
def self.replace_values(input, user)
return input.gsub(/%%channel_\d+_field_\d+%%/) { |string| Channel.value_from_string(string, user) }
end
# access a last value by string: channel_1417_field_1
def self.value_from_string(channel_string, user)
# remove % from the string and create the array