rubyzoho icon indicating copy to clipboard operation
rubyzoho copied to clipboard

Features/fields translations

Open brenes opened this issue 10 years ago • 10 comments

Changes needed to translate fields from Zoho to Ruby and remember the proper translations, as explained in #29

This way, I can have an utm_campaing attribute in my Zoho and Ruby will remember that the original attribute is not called Utm Campaign but utm_campaign.

I have tested it with our application (not in production yet) But I couldn't run any spec because I don't have a usable Zoho API Key (the only one I have is populated with real data and I can't run specs over them). Is there any procedure to run specs without a real API Key?

brenes avatar Aug 19 '14 21:08 brenes

Coverage Status

Coverage decreased (-67.87%) when pulling e8838b5d428932ddeff362b372a1687fd43c5f6e on simplelogica:features/fields-translations into ed496cfc94e1d0c6703de7d6373b317e4d18ce23 on amalc:master.

coveralls avatar Aug 19 '14 21:08 coveralls

No, there isn't but you can sign up for one of the free accounts. Just be careful about running just the one spec, though so you don't use up all of the calls.

On Tue, Aug 19, 2014 at 5:06 PM, brenes [email protected] wrote:

Changes needed to translate fields from Zoho to Ruby and remember the proper translations, as explained in #29 https://github.com/amalc/rubyzoho/issues/29

This way, I can have an utm_campaing attribute in my Zoho and Ruby will remember that the original attribute is not called Utm Campaign but utm_campaign.

I have tested it with our application (not in production yet) But I couldn't run any spec because I don't have a usable Zoho API Key (the only one I have is populated with real data and I can't run specs over them). Is

there any procedure to run specs without a real API Key?

You can merge this Pull Request by running

git pull https://github.com/simplelogica/rubyzoho features/fields-translations

Or view, comment on, or merge it at:

https://github.com/amalc/rubyzoho/pull/30 Commit Summary

  • First we store translations when getting fields through the fields_for_api method
  • Then we store them when using the fields_from_record method
  • And now, when building the XML we look for the translation

File Changes

  • M lib/zoho_api.rb https://github.com/amalc/rubyzoho/pull/30/files#diff-0 (8)
  • M lib/zoho_api_field_utils.rb https://github.com/amalc/rubyzoho/pull/30/files#diff-1 (20)

Patch Links:

  • https://github.com/amalc/rubyzoho/pull/30.patch
  • https://github.com/amalc/rubyzoho/pull/30.diff

— Reply to this email directly or view it on GitHub https://github.com/amalc/rubyzoho/pull/30.

amalc avatar Aug 19 '14 22:08 amalc

@brenes Did you get a chance to test this?

amalc avatar Aug 22 '14 13:08 amalc

Sorry, I had the most busy month at work and couldn't take a look :(

I'll try to test this in the following days.

brenes avatar Sep 16 '14 18:09 brenes

No worries. I need to get a new version out as well with the number of records returned fix.

On Tue, Sep 16, 2014 at 2:01 PM, brenes [email protected] wrote:

Sorry, I had the most busy month at work and couldn't take a look :(

I'll try to test this in the following days.

— Reply to this email directly or view it on GitHub https://github.com/amalc/rubyzoho/pull/30#issuecomment-55785733.

amalc avatar Sep 16 '14 18:09 amalc

@brenes Had to manually do the merge. Will test and release in the next couple of days. Thanks!

amalc avatar Feb 23 '15 17:02 amalc

Thanks to you! And sorry for not being able to test it in months :(

brenes avatar Feb 24 '15 09:02 brenes

@amalc We had an issue with a field containing a '/'. I solved it in my branch by cleaning it on the ApiUtils#string_to_symbol and everything worked fine.

I don't know if there's a way to obtain a right ruby variable name from a string with strange characters, so this problem doesn't repeat on the future.

brenes avatar Mar 25 '15 09:03 brenes

I've got your changes for mapping in master to map between fields. Will release as soon as I test. Thanks for the heads up.

amalc avatar Mar 25 '15 12:03 amalc

I'll add a reg ex to always generate a legal ruby variable. I take it you're using the mapping fixes you added? If you're processing a field with '/'?

amalc avatar Mar 26 '15 15:03 amalc