lib/apartment.rb in apartment-0.23.0 vs lib/apartment.rb in apartment-0.23.1
- old
+ new
@@ -66,25 +66,28 @@
self.use_schemas = to_use_or_not_to_use
end
end
# Exceptions
- class ApartmentError < StandardError; end
+ ApartmentError = Class.new(StandardError)
# Raised when apartment cannot find the adapter specified in <tt>config/database.yml</tt>
- class AdapterNotFound < ApartmentError; end
+ AdapterNotFound = Class.new(ApartmentError)
+ # Tenant specified is unknown
+ TenantNotFound = Class.new(ApartmentError)
+
# Raised when database cannot find the specified database
- class DatabaseNotFound < ApartmentError; end
+ DatabaseNotFound = Class.new(TenantNotFound)
- # Raised when trying to create a database that already exists
- class DatabaseExists < ApartmentError; end
-
# Raised when database cannot find the specified schema
- class SchemaNotFound < ApartmentError; end
+ SchemaNotFound = Class.new(TenantNotFound)
- # Raised when trying to create a schema that already exists
- class SchemaExists < ApartmentError; end
+ # The Tenant attempting to be created already exists
+ TenantExists = Class.new(ApartmentError)
- # Raised when an ActiveRecord object does not have the required database field on it
- class DJSerializationError < ApartmentError; end
+ # Raised when trying to create a database that already exists
+ DatabaseExists = Class.new(TenantExists)
+
+ # Raised when trying to create a schema that already exists
+ SchemaExists = Class.new(TenantExists)
end