Skip to content

Instantly share code, notes, and snippets.

View sandeshsoni's full-sized avatar
👨‍💻
searching work

Sandesh Soni sandeshsoni

👨‍💻
searching work
View GitHub Profile
@gmontard
gmontard / domain.rb
Last active October 20, 2023 21:44
Rails dynamic domain and subdomain routes constraint
# -*- encoding : utf-8 -*-
class Domain < ActiveRecord::Base
after_save :reload_routes
def reload_routes
if self.domain_changed?
REDIS.set("rails_routes_ts", "expired")
end
end