nytimes / Fech

Deprecated. Please see https://github.com/dwillis/Fech for a maintained fork.
http://nytimes.github.io/Fech/
Other
115 stars 30 forks source link

Ensure filing's have access to a translator, regardless of whether it was initialized with one #66

Closed abstrctn closed 10 years ago

abstrctn commented 10 years ago

Changed Fech::Filing#translator from being an attr_accessor to a memoization method. This ensure that a Translator is available to all filings by calling #translator on a Filing instance, even if one wasn't created when the Filing was instantiated.

This guards against a bug where a Filing is initially created without any default translations, but one later attempts to add an ad hoc translation by calling filing#translate, or by accessing the translator directly with filing#translator.