lib/document_number.rb in document_number-0.9.2 vs lib/document_number.rb in document_number-0.9.3
- old
+ new
@@ -1,9 +1,25 @@
-require "document_number/document_number"
+require "document_number/configuration"
require "document_number/has_document_number"
require "document_number/numerator"
+require "document_number/document_number"
-# ActiveRecord::Base.send :include, DocumentNumber
+module DocumentNumber
+ # Default prefix for number
+ def self.prefix=(value)
+ ::DocumentNumber.configuration.prefix = value
+ end
+ private
+
+ def self.configuration
+ @@configuration ||= ::DocumentNumber::Configuration.instance
+ end
+
+ def self.configure
+ yield configuration
+ end
+end
+
ActiveSupport.on_load(:active_record) do
- include DocumentNumber::Model
+ include ::DocumentNumber::Model
end