This file contains hidden or 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
class OrphanAnnie | |
class << self | |
def perform | |
fake_orphan_locations = mom_is_that_you | |
write_to_loggers("#{fake_orphan_locations}") | |
rehome_fake_orphans | |
write_to_loggers("There are #{Widget.orphans.count} orphans left.") | |
Resque.enqueue(WidgetCleanupJob) | |
end |
This file contains hidden or 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
class OrphanAnnie | |
def self.perform | |
lost_souls = mom_is_that_you | |
write_to_loggers("#{lost_souls}") | |
end | |
def self.mom_is_that_you | |
names = Widget.orphans.select {|i| !i.parent_widget.nil?} | |
web_pages = names.map {|w| | |
self.get_infos(w) |
This file contains hidden or 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
## Boot chumps from your heroku free dynos | |
## PS the app | |
heroku ps -a [APP] | |
## Find that one-off process, snag that pid | |
=== run: one-off processes (1) | |
run.4570 (Free): up 2016/03/03 10:01:16 -0800 (~ 8m ago): bin/rails console | |
## Tossed like a chump |
This file contains hidden or 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
## G5 Content Management System | |
def find_setting_value(target) | |
Setting.where(Setting.arel_table[:value].matches("%#{target}%")) | |
end | |
def find_setting_value_widgets(target) | |
find_setting_value(target).map do |setting| | |
setting.owner | |
end.uniq |
This file contains hidden or 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
def repair_drop_targets(html_id, widgets=[]) | |
bad = Website.all.select do |web| | |
!web.website_template.blank? && ( | |
web.website_template.drop_targets.find_by_html_id(html_id).blank? || | |
web.website_template.drop_targets.find_by_html_id(html_id).widgets.blank?) | |
end | |
bad.each do |web| | |
wt = web.website_template | |
dt = wt.drop_targets.find_by_html_id(html_id) |
OlderNewer