Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

be explicit about depending on AR

  • Loading branch information...
commit 9832fe243312042549c84ba8b7f3c7e92785e3b4 1 parent e4d5846
Lukas Westermann lwe authored
Showing with 9 additions and 7 deletions.
  1. +1 −1  init.rb
  2. +8 −6 lib/simple_enum.rb
2  init.rb
View
@@ -1 +1 @@
-require File.join(File.dirname(__FILE__), 'lib', 'simple_enum')
+require 'simple_enum'
14 lib/simple_enum.rb
View
@@ -242,9 +242,11 @@ def enum_definitions
end
# Tie stuff together and load translations if ActiveRecord is defined
-if Object.const_defined?('ActiveRecord')
- Object.send(:include, SimpleEnum::ObjectSupport)
-
- ActiveRecord::Base.send(:include, SimpleEnum)
- I18n.load_path << File.join(File.dirname(__FILE__), '..', 'locales', 'en.yml')
-end
+Object.send(:include, SimpleEnum::ObjectSupport)
+
+# because we depend on AR and i18n
+require 'active_record'
+require 'i18n'
+
+ActiveRecord::Base.send(:include, SimpleEnum)
+I18n.load_path << File.join(File.dirname(__FILE__), '..', 'locales', 'en.yml')
Please sign in to comment.
Something went wrong with that request. Please try again.