[TESTS] Tightened up integration tests for model delete callbacks [#70]
[DOC] Added more consistent example of bulk importing documents into index with mapping to the README [Closes #71]
[IMPORT] Changed, that bulk import works on a clone of original document, since we mess with it in get_type_from_document etc

See http://groups.google.com/group/elasticsearch/msg/a80bb6ae6753fcee for original issue report
[FIX] Fixed issues with adding Model#destroyed into ActiveRecord classes on Ruby 1.9.2

Reported by @roccoblues. Closes #70, #73.
[ACTIVEMODEL] [¡BREAKING!] Wrap search results in Item class, not the actual model class [Closes #11]

Due to the problem with indexing and retrieving ActiveRecord models with associations (such as Article has_many :comments),
do not wrap the results in the model class, but in the Tire::Configuration.wrapper class.

See the https://github.com/karmi/tire/issues/10 issue for explanation.

This commit breaks the old behaviour and usage in Rails, since Results::Item is not (yet) ActiveModel compatible.
Changed that Results::Item does uses delegation to Hash, not inheritance from Hash

(Anything which `is_a?(Hash)` breaks routes and other stuff in Rails.)
[ACTIVEMODEL] Changed, that Results::Item is ActiveModel (= Rails) compatible [#11]

Results::Item instances are now ActiveModel compatible, and can be used
within Rails effortlessly. Routes, `dom_id`-style helpers, etc work as expected.

This is achieved by masquerading as an instance of the underlying model,
based on the `_type` property retrieved from ElasticSearch.

Outside Rails, Results::Item does not masquerade itself.

This change, combined with tire@05a1331 allows for more
flexibility for indexing and loading back ActiveRecord records.

All the Rails views can use the <Item> instances carefree, having
access to all the properties/attributes which were indexed by the
standard dot notation: `article.comments.first.author`, etc.

Closes #11.
[FIX] Fixed, that Results::Item.new properly wraps values passed in Arrays

(Hashes are converted to Results::Item for easy dot access, other values left alone.)
[ACTIVEMODEL] Added the `Results::Item#load` method, to load the "real" model instance from database [#12]

In accord with issue karmi/tire#11 (see also 05a1331, be7621a, 90de105), this change provides a way to load
the "real" model instance from the database/storage.

All results are wrapped in Tire::Results::Item, by default, which provides fast and flexible access
to the properties returned from ElasticSearch (`_source` or `fields` JSON properties).

This way, we can index whatever we like for ElasticSearch and retrieve it. If, and only if we
need the access to the underlying model (eg. to its methods), we call item.load.<my_special_method>.

An example would be an article with comments:

    >> a = Article.first
      Article Load (4.4ms)  SELECT "articles".* FROM "articles" LIMIT 1
    => #<Article id: 3, title: "Three", content: "Consectetur...", published_on: "2011-07-11", ...>

    >> a.comments
      Comment Load (0.7ms)  SELECT "comments".* FROM "comments" WHERE ("comments".article_id = 3)
    => [#<Comment id: 1, author: "john", body: "Awesome!", article_id: 3, created_at: "2011-07-14 07:04:54", ..., #<Comment id: 2, author: "mary", body: "Yeah!", article_id: 3, created_at: "2011-07-14 07:06:15", ...>]

Now, we have the Article class like this:

    class Article < ActiveRecord::Base
      include Tire::Model::Search
      include Tire::Model::Callbacks

      has_many :comments

      mapping do
        indexes :title
        indexes :content
        indexes :published_on, :type => 'date'

        indexes :comments do
          indexes :author
          indexes :body
        end
      end

      def to_indexed_json
        {
          :title        => title,
          :content      => content,
          :published_on => published_on,
          :length       => length,

          :comments     => comments.map { |c| { :author => c.author, :body => c.body } },
        }.to_json
      end

      def length
        content.length
      end

      def comment_authors
        comments.map(&:author).to_sentence
      end
    end

We will search for articles:

    >> @articles = Article.search('three')
    => #<Tire::Results::Collection:0x10378f948 ...>

    @articles.each do |article|
      puts article.title
      puts article.load(:include => 'comments').comment_authors
    end

Now, we can access the *indexed* properties, as well as the *model* properties:

    >> @articles.each do |article|
    >>   puts article.title
    >>   puts article.load(:include => 'comments').comment_authors
    >> end
    Three
      Article Load (0.6ms)  SELECT "articles".* FROM "articles" WHERE "articles"."id" = 3 LIMIT 1
      Comment Load (0.3ms)  SELECT "comments".* FROM "comments" WHERE ("comments".article_id = 3)
    john and mary

Closes #12. Closes #10.
[DOC] Minor edits to documentation and Readme (update `sort` info; style edit)
[DOC] Added note about 1.8 and 1.9 compatibility
[DOC] Added the information on new ActiveRecord integration to the Readme [#11,#12]
[TESTS] Removed `sleep` calls in test suite, seems to not need them anymore on > 0.16.4
[ACTIVEMODEL] Added the `:load` option for search to eagerly load model instances from the database

In ActiveModel/ActiveRecord implementation, there's an option to load the "real",
underlying model with the `load` method. This allows
for loading the records only one-by-one, though.

An option as `:load => true` for the search methods will eagerly load all the records
from the database (in Results::Tire::Collection#results),
based on IDs returned from ElasticSearch:

    Article.search 'love', :load => true
    => Article.find [1, 2]

Any option other then TrueClass given as `:load` will be passed
to the model's `find` method:

    Article.search 'love', :include => 'comments'
    => Article.find [1, 2], :include => 'comments'

This allows to use Tire (and ElasticSearch) to retrieve batches of records at once,
when needed (eg. in export jobs).

[Closes #61]
Changed the method arguments parsing in Tire::Model::Search::ClassMethods#search for more fluid interface

Given changes in tire@ba460a5 (see #61), the interface for block searches with options was demented:

    results = ActiveRecordArticle.search nil, :load => true do
      ...
    end

The new interface is sane:

results = ActiveRecordArticle.search :load => true do
  ...
end
[DOC] Added the documentation on eager loading results from the database from search [#61] [#12]
[ACTIVERECORD] Fixed errors when empty resultset was returned from ES with eager loading of records

Thanks @joshkalderimis for the report. Closes #68.
[TEST] Fixed an error where ResultsCollectionTest was failing due to _type being picked up
[TEST] Added test for paginated search in persistent model
Updated the Rails application template for will_paginate proper release 3.0