fix exception "ActiveRecord::ConfigurationError: Association named 'INNER JOIN..." when merging relation with String joins
added test for search on relation with merged String join
Merge pull request #376 from iquest/rails-4.1

Search should work on relation with merged String join