lib/biggs.rb in biggs-0.2.2 vs lib/biggs.rb in biggs-0.3.0
- old
+ new
@@ -1,21 +1,20 @@
+require 'biggs/format'
require 'biggs/formatter'
require 'yaml'
module Biggs
class << self
def formats
@@formats ||= YAML.load_file(File.join(File.dirname(__FILE__), '..', 'formats.yml')) || {}
end
- def enable_activerecord
- return if ActiveRecord::Base.respond_to? :biggs_formatter
- require 'biggs/activerecord'
- ActiveRecord::Base.send :include, Biggs::ActiveRecordAdapter
+ def country_names
+ @@country_names ||= YAML.load_file(File.join(File.dirname(__FILE__), '..', 'country_names.yml')) || {}
end
end
end
-if defined?(ActiveRecord) and defined?(ActiveRecord::Base)
- Biggs.enable_activerecord
-end
-
+if defined?(ActiveRecord) and defined?(ActiveRecord::Base) and !ActiveRecord::Base.respond_to?(:biggs_formatter)
+ require 'biggs/activerecord'
+ ActiveRecord::Base.send :include, Biggs::ActiveRecordAdapter
+end
\ No newline at end of file