daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. return true if option.conditions.blank?
  2.     conditional_string = option.conditions
  3.     variable_array = option.conditions.split(/[!&(),]/)
  4.     variable_array = variable_array.find{|variable| !variable.blank?}
  5.     unless variable_array.blank?
  6.       variable_array.each do |variable|
  7.         included = listing.options.split(',').include?(variable)
  8.         conditional_string.gsub!(variable, included.to_s)
  9.       end
  10.     end
  11.     conditional_string.gsub!('&', '&&').gsub!(',', '||')
  12.     eval(conditional_string)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top