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
namespace :utils do | |
desc "Clean up papertrail versions: delete unfound associations" | |
task :clean_versions => :environment do | |
Version.all.each do |ver| | |
klass = ver.item_type.constantize | |
#Call unscoped in case delete flag is set, and item is still in db. | |
item = klass.unscoped.find_by_id(ver.item_id) | |
if item.nil? |
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
module Producers | |
class DataModelA | |
... # Some ruby magic to return the correct subclass for a state | |
def page | |
@page ||= Nokogiri.new(URL) | |
end | |
end | |
class SpecificState < DataModelA |
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
# Created by essentially answering all of the methods that were called on a PORO. Adjust as you see fit | |
module ActiveAdminModelStubs | |
extend ActiveSupport::Concern | |
# duck punch - ActiveAdmin uses these for index page. We don't have an index. | |
module ClassMethods | |
# Columns makes no sense in the context of a form. | |
def columns(*) | |
[] |
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
ruby '2.2.0' | |
source 'https://rubygems.org' | |
... | |
gem 'font-awesome-rails' |