Skip to content

Commit

Permalink
bug fix: was always requiring both mongoid & rails
Browse files Browse the repository at this point in the history
the defined? guards were checking string literals rather than symbols, so were always returning true.  

(for the case of Mongoid this meant that symbolize/mongoid was always being included, which as a side effect caused the symbol ::Mongoid to be defined, which then broke other gems which likewise checked for the existence of that symbol before doing mongo-specific things)
  • Loading branch information
ronen committed Feb 19, 2013
1 parent 4e45ce0 commit b7b5965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/symbolize.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ module Symbolize
autoload :ActiveRecord, 'symbolize/active_record' autoload :ActiveRecord, 'symbolize/active_record'
end end


require 'symbolize/mongoid' if defined? 'Mongoid' require 'symbolize/mongoid' if defined? Mongoid
require 'symbolize/railtie' if defined? 'Rails' require 'symbolize/railtie' if defined? Rails

0 comments on commit b7b5965

Please sign in to comment.