lib/condo/configuration.rb in condo-2.0.1 vs lib/condo/configuration.rb in condo-2.0.2
- old
+ new
@@ -1,19 +1,15 @@
-require 'singleton'
-
module Condo
-
class Configuration
- include Singleton
-
-
@@callbacks = {
+ # Must be defined by the including class:
+ #:resident_id => proc
+ #:bucket_name => proc
+ #:upload_complete => proc
+ #:destroy_upload => proc
#
- #:resident_id # Must be defined by the including class
- #
- :bucket_name => proc {"#{Rails.application.class.parent_name}#{instance_eval @@callbacks[:resident_id]}"},
:object_key => proc { |upload|
if upload[:file_path]
upload[:file_path] + upload[:file_name]
else
upload[:file_name]
@@ -40,11 +36,9 @@
# Where config === ::Condo::Configuration
# and resident_id is the result of the resident_id callback
# upload will only be present if it already exists
config.residencies[0]
}
- #:upload_complete # Must be defined by the including class
- #:destroy_upload # the actual delete should be done by the application
}
def self.callbacks
@@callbacks
end