Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thescubageek/bf1564478a9b278421f190862e1f8bee to your computer and use it in GitHub Desktop.
Save thescubageek/bf1564478a9b278421f190862e1f8bee to your computer and use it in GitHub Desktop.
finds phone number widgets with values for the phone_number field
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