Sha256: 6f0249323fcf33ae2dd97c3a1bd988e25de4377ed7f220bd6f27d026fc06dd6b
Contents?: true
Size: 1.33 KB
Versions: 35
Compression:
Stored size: 1.33 KB
Contents
class Application < Rhoconnect::Base class << self def authenticate(username,password,session) true # do some interesting authentication here... end # Add hooks for application startup here # Don't forget to call super at the end! def initializer(path) super end # Calling super here returns rack tempfile path: # i.e. /var/folders/J4/J4wGJ-r6H7S313GEZ-Xx5E+++TI # Note: This tempfile is removed when server stops or crashes... # See http://rack.rubyforge.org/doc/Multipart.html for more info # # Override this by creating a copy of the file somewhere # and returning the path to that file (then don't call super!): # i.e. /mnt/myimages/soccer.png def store_blob(object, field_name, blob) # Pass to BlobAdapter path to image and its original name if blob object['filename'] = blob[:filename] object['image_uri'] = blob[:tempfile].path end super end end end Application.initializer(ROOT_PATH) # Support passenger smart spawning/fork mode: if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| if forked # We're in smart spawning mode. Store.db.client.reconnect else # We're in conservative spawning mode. We don't need to do anything. end end end
Version data entries
35 entries across 35 versions & 1 rubygems