Sha256: d7fa4c0fdb476c273631d6a9688081a7d4c7245e7bfd1352f1950847635c4ce4

Contents?: true

Size: 396 Bytes

Versions: 8

Compression:

Stored size: 396 Bytes

Contents

module BlacklightUserGeneratedContent
  module Findable
    # Override RSolr finder method to mock ActiveRecord#find
    # Provide  a mock method for #find
    # XXX this seems slightly dangerous as is, but seems to work well enough
    def find *args
      if args.first.is_a? String
        return super(:qt => :document, :id => args.first).first
      end
      super(*args)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight_user_generated_content-0.0.8 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.7 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.6 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.5 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.4 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.3 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.2 lib/blacklight_user_generated_content/findable.rb
blacklight_user_generated_content-0.0.1 lib/blacklight_user_generated_content/findable.rb