2-1-stable: fix deleting a parent may lead to a stale object error

Redmine Defect 7920
Attempted to update a stale object when copying a project
http://www.redmine.org/issues/7920

This revision passes Redmine test.
http://www.redmine.org/projects/redmine/repository/entry/trunk/test/unit/issue_nested_set_test.rb?rev=12679#L244

https://travis-ci.org/marutosi/redmine/jobs/17215987#L1979

<pre>
  1) Error:
test_destroy_parent_issue_updated_during_children_destroy(IssueNestedSetTest):
ActiveRecord::StaleObjectError: Attempted to destroy a stale object: Issue
    app/models/issue.rb:179:in `destroy'
    test/unit/issue_nested_set_test.rb:250:in `test_destroy_parent_issue_updated_during_children_destroy'
    test/unit/issue_nested_set_test.rb:249:in `test_destroy_parent_issue_updated_during_children_destroy'
</pre>
2-1-stable: fix ActiveRecord::StatementInvalid: Error: Column 'lft' in order clause is ambiguous

On 2-1-stable 3d5ac746542, Redmine test fails.
https://bitbucket.org/marutosi/redmine-bb-awesome_nested_set-use-gem/src/2ac1078370/Gemfile#cl-10
https://drone.io/bitbucket.org/marutosi/redmine-bb-awesome_nested_set-use-gem/2

<pre>
 13) Error:
    test_visible_and_nested_set_scopes(IssueTest):
    ActiveRecord::StatementInvalid: Mysql2::Error: Column 'lft' in order clause is ambiguous:
</pre>

http://www.redmine.org/projects/redmine/repository/revisions/12689/annotate/trunk/test/unit/issue_test.rb#L332
<pre>
  def test_visible_and_nested_set_scopes
    assert_equal 0, Issue.find(1).descendants.visible.all.size
  end
</pre>
Fix for mssql with jruby/activerecord-jdbc-adapter

Fix for the following error with mssql with jruby/activerecord-jdbc-adapter:
ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: No column was specified for column 3 of 't'.: SELECT t.* FROM ( SELECT ROW_NUMBER() OVER(ORDER BY MIN(users.id)) AS _row_num, [users].[lft], COUNT([users].[lft]) FROM [users]  GROUP BY [users].[lft] HAVING COUNT([users].[lft]) > 1 ) AS t WHERE t._row_num BETWEEN 1 AND 1
updated_at is changed on move.

Conflicts:
	lib/awesome_nested_set/move.rb
Refactored conditions logic to include updated_at

Conflicts:
	lib/awesome_nested_set/move.rb
Merge pull request #234 from marutosi/2-1-stable-fix-stale-object-error

2-1-stable: fix deleting a parent may lead to a stale object error
Merge pull request #235 from marutosi/2-1-stable-fix-order

2-1-stable: fix ActiveRecord::StatementInvalid: Error: Column 'lft' in order clause is ambiguous
Merge pull request #236 from soemo/2-1-stable

Fix for mssql with jruby/activerecord-jdbc-adapter
not use max rgt cache