Sha256: c5501e1a80301d6576d40d73d1381540c13690b5bcf6bab2378aa3aafeed82cc
Contents?: true
Size: 696 Bytes
Versions: 12
Compression:
Stored size: 696 Bytes
Contents
require 'orange-core/middleware/base' module Orange::Middleware # This will load information about the site to into the orange env # - packet['site'] will be an instance of the site object # class SiteLoad < Base def packet_call(packet) url = packet['route.site_url'] site = OrangeSite.first(:url.like => url) if site packet['site'] = site elsif orange.options[:development_mode] s = OrangeSite.new({:url => packet['route.site_url'], :name => 'An Orange Site'}) s.save packet['site'] = s else packet['site'] = OrangeSite.first end pass packet end end end
Version data entries
12 entries across 12 versions & 2 rubygems