globalize/globalize — pull request #298 by etagwerker (2013-11-07 19:50:28+00:00)
Title: Fix paper trail compatibility

Hello!

This is a proposed solution to issue #206, for the case where a model has both `has_paper_trail` and `translates :versioning => true`

I've added the case to the set of tests.

The code will only delegate #version and #versions to the translation class if the model doesn't already have paper_trail enabled.

I believe there will be a problem if you define your model like this:

````
class Paper < ActiveRecord::Base
translates :description, :versioning => true
has_paper_trail :only => [:name]
````

The problem will be that `#version` and `#versions` will call the _translation_ methods.

If you define it like this:
````
class Paper < ActiveRecord::Base
has_paper_trail :only => [:name]
translates :description, :versioning => true
````

It should work alright.

I understand it's not ideal to have to order the statements, but I wanted to keep the contribution backwards compatible.

With this contribution, if you want to have `has_paper_trail` and `translates :versioning => true` in the same model, you will have to access versions like this:
````
# for object's paper trail
obj.versions
# for object's translations paper trail
obj.translation.versions
````

Any comments will be appreciated.

I hope this helps.

Thanks!