Last active
March 4, 2017 14:34
-
-
Save thescubageek/bf1564478a9b278421f190862e1f8bee to your computer and use it in GitHub Desktop.
finds phone number widgets with values for the phone_number field
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
widgets = Widget.includes(:garden_widget, :settings).by_name('Phone Number').all | |
settings = widgets.map { |w| w.settings.where_name('phone_number').all }.squish.select { |s| s.value.present? && && s.value != "{{location_phone_number}}" } | |
ret = settings.inject("") { |str, s| str << "- #{s.website.name} (#{s.website.owner.urn}) - #{s.website.status}): #{s.value}\n"; str } | |
puts "#{Client.client.name} (#{Client.client.urn}):\n#{ret}\n" unless ret.blank? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment