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
# Keeping track of associations in activerecord and then going over to draper decorators and adding new associations is | |
# something that I never much liked - multiple places meant a potential error. | |
# so here's an easy draper concern that keeps your draper decorators in sync with your underlying models. | |
# just `include AutoDecorateAssociations` on your decorators and you're done worrying about changing associations on your models. | |
# If you're working with a model that doesn't have a decorator - like papertrail then it can be easily excluded like :versions below. | |
module AutoDecorateAssociations | |
extend ActiveSupport::Concern | |
included do |
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 SubdomainConstraint | |
# used in routes to generate subdomains | |
# note there is a cache buster in company.rb in case the subdomain is updated - `reload_routes` | |
# update it if we write any additional cache entries here | |
RESERVED_SUB_DOMAINS = %w[ | |
www app admin test staging help support wwww cdn owner media intercom mail r _domainkey blog webhooks webhook | |
hooks api api-test api-staging referral outbound mail webmail w3 mailboxes io heroku inbound google search | |
].freeze |