Skip to content

Commit

Permalink
Load ActiveSupport JSON support correctly for major Rails versions > 4
Browse files Browse the repository at this point in the history
  • Loading branch information
zgchurch committed Mar 30, 2014
1 parent 6b8f5ae commit 5c868ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sunspot_rails/lib/sunspot_rails.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This needs to be loaded before sunspot/search/paginated_collection
# or #to_json gets defined in Object breaking delegation to Array via
# method_missing
if Rails::VERSION::MAJOR >= 4 && Rails::VERSION::MINOR >= 1
if Rails::VERSION::MAJOR > 4 || (Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 1)
require 'active_support/core_ext/object/json'
else
require 'active_support/core_ext/object/to_json'
Expand Down

0 comments on commit 5c868ea

Please sign in to comment.