Skip to content

Conversation

@tim-vandecasteele
Copy link

Make it possible to use title_en_was.

This duplicates some dirty_tracking code but I didn't see another way.

@tamadamas
Copy link

@tim-vandecasteele I tried your solution, but It's wrong for me.
I wrote own solution but without _was feature.
https://github.com/mli-max/globalize-accessors/commit/7fb5307e703008020b95622b262fa39e16d10af0

Your solution fails in my tests with error

Failure/Error: expect(execution_summary.changes[:title_en]).to eq [nil, "New title"]

       expected: [nil, "New title"]
            got: ["Canyoning sur le Rhône", "New title"]

It got from default title value. It's a bit unsuspected but it should be nil like in Rails way

      expect(execution_summary.changes[:title_en]).to eq nil
      execution_summary.title_en = 'New title'

      expect(execution_summary.title_en).to eq 'New title'
      expect(execution_summary.changes[:title_en]).to eq [nil, "New title"]

So, I had fr title value in title_en

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants