Skip to content

Latest commit

 

History

History
680 lines (557 loc) · 30.8 KB

CHANGELOG.md

File metadata and controls

680 lines (557 loc) · 30.8 KB

Mobility Changelog

1.3

(unreleased)

  • Allow I18n.available_locales to contain Strings (#612)

1.3.0.rc3

  • Don't try to load generators if Rails is loaded but AR is not (#627), thanks flop!
  • Allow compound foreign keys (#632), thanks mival!
  • Fix active model *_previously_changed? and active record will_save_change_to_*? and saved_change_to_*? dirty methods to accept kwargs (#639) thanks doits!

1.3.0.rc2

  • Pass coder as keyword argument to serialize (ActiveRecord version > 7.1) (#617)

1.3.0.rc1

This version includes potentially breaking chnages for jsonb and hstore backends. See PRs below for details.

  • Fix ActiveRecord JSONB blank values (#536)
  • Support primary keys other then :id on model classes (#542)
  • Clean up and refactor container backend (#543), thanks doits!
  • Update fallthrough_accessor regex to allow for ISO 639-2 codes (#580) thanks phil-allcock!

1.2

1.2.9

  • Fix missing method mobility_attribute? on Rails 7 (#582 and #584)

1.2.8

  • Fix issues with subclassing, such as when using AR STI, fixes #566 (#568)
  • Handle attribute_method_matchers rename (part of #560)

1.2.7

  • Do not query same attribute more than once, fixes #564 (#577)

1.2.6

  • Require mfa on rubygems (#545)

1.2.5

  • Avoid referencing ActiveRecord::Base (#550)

1.2.4

  • Fix fallbacks performance regression (#548)

1.2.3

  • Fix passing wrong options to super in fallbacks plugin (#539)

1.2.2

  • Make models work with Marshal.dump (#532)
  • Fix Sequel container op in Sequel (#533)
  • Simplify Fallbacks plugin (#531)

1.2.1

  • Refactor ColumnFallback plugin (#530)

1.2.0

  • Add ColumnFallback plugin (#512)
  • Fix Sequel querying on untranslated attributes in i18n block (#529)
  • Allow passing configured backend class as third argument to setup (#528)
  • Clearly distinguish backend classes from their configured subclasses (#527)

1.1

1.1.3

  • Do not swallow keyword args on ruby 3 in fallthrough accessors (#520) thanks doits!
  • Assign blank values in pg hash backends (#516)

1.1.2

  • Check whether class responds to mobility_attribute? (#515)

1.1.1

  • Updated signing key

1.1.0

  • Remove Mobility::Plugins::Attributes#each (#475)
  • Add public method Mobility::Plugins::ActiveRecord::Query.build_query (#471)
  • Allow setting locale per node in query block (#479)
  • Add Mobility.validate_locale! (#479)
  • Call after_destroy in setup block to delete associated translations (#487)
  • Add key, value and belongs_to options to key-value backend (#488) thanks sedubois!

1.0

1.0 is a rewrite of many internals of the gem. Please see the wiki page on v1.0 for more details on how to upgrade.

1.0.7

  • Require set before using Set (#503)

1.0.6

  • Merge options including defaults into backend options (#502)

1.0.5

  • Fix duping with AR Table backend, fixes #490 (#499 and #501)

1.0.4

  • Correctly override default backend options, fixes #492 (#495)

1.0.3

  • Fix Mobility.default_backend (#497)

1.0.2

1.0.1

  • Make Mobility::Plugins::ActiveRecord::Query::VirtualRow and Mobility::Plugins::ActiveRecord::Query::QueryExtension (#471) public
  • Fix typo in initializer template (#474)

1.0.0

1.0.0.rc1 (pre-release)

  • Remove Mobility::ActiveRecord, Mobility::Sequel and Mobility::Arel, and general cleanup (#464)

1.0.0.beta2 (pre-release)

  • Refactor attributes & backend plugins and make mobility_attributes public (#462)
  • Make attribute_methods plugin depend on attributes (#461)

1.0.0.beta1 (pre-release)

  • Remove Mobility::Backend#apply_plugin (#454)
  • Instance exec configure block if it takes no arguments (#456)
  • Raise an exception if invalid options are passed to Translations initializer (#457)
  • Fix Ruby 2.7 deprecation warnings (#460)

1.0.0.alpha (pre-release)

  • Default fallbacks plugin to true when enabled (#447)
  • Remove Mobility::Backend.method_name (#400)
  • Remove translated_attribute_names as alias for mobility_attributes (#402)
  • Move _backend methods into backend_reader plugin (#403)
  • Replace Configuration#query_method configuration with Query plugin option (#414)
  • Remove Mobility::Configuration#default_accessor_locales. Use plugin option to configure global default instead. (#424)
  • Pass model_class to Mobility::Backend#configure via class method rather than on options hash (#429)
  • Remove Mobility.new_fallbacks and Configuration#fallbacks_generator (#433)
  • Rename backend_name to backend (#443)
  • Remove Configuration#accessor_method (#450)
  • Rename Mobility::Attributes to Mobility::Translations
  • Remove Mobility::Configuration altogether (#452)

0.8

0.8.13 (May 27, 2020)

  • Fix fallthrough accessor method_missing not passing all options to super (#364, #384, #377, thanks doits!)

0.8.12 (May 15, 2020)

(yanked)

0.8.11 (May 14, 2020)

  • Handle select with block (#359, thanks dlcmh!)

0.8.10 (February 11, 2020)

  • Enforce case_sensitive comparison for Rails 6.1 (#333, thanks morozRed!)

0.8.9 (October 25, 2019)

  • Fix Dirty plugin to work with Rails 6 (#343, #348, #352 on master branch, plus #351 to sync to 0-8-stable branch). Summary of changes here.

0.8.8 (September 18, 2019)

0.8.7 (November 30, 2018)

  • Handle case when attribute name passed to has_attribute is not a string (#309).

0.8.6 (November 23, 2018)

0.8.5 (November 1, 2018)

  • Load column_type when building node (#301)

0.8.4 (October 19, 2018)

  • Use references to define polymorphic associations in generator migrations (#292)

0.8.3 (October 1, 2018)

  • Handle untranslated scopes in AR query module (#288)

0.8.2 (September 28, 2018)

  • Support pluck, select and group methods on translated attributes (#284, #285)

0.8.1 (September 25, 2018)

  • Default ActiveRecord Table/KeyValue backends to OUTER JOIN (#277)
  • Default Sequel Table/KeyValue backends to OUTER JOIN (#279)
  • Do not skip generator on :revoke behavior (#274). Thanks mauriciopasquier!
  • Bump i18n dependency to allow versions up to 2.0 (#280)
  • Use references and foreign_key in Table migration generator (#282 and #283) Thanks omitter!

0.8.0 (September 11, 2018)

  • Support order clause on translated queries (ActiveRecord) (#261)
  • Restructure Sequel querying into plugin (#255, #267, #268)
  • Default locale to Mobility.locale in apply_scope (#263)
  • Require Ruby version 2.3.7 or greater (#242)

0.7.6 (July 6, 2018)

  • Sequel pg_hash require hash_initializer (#260). Thanks @Recca!

0.7.5 (June 8, 2018)

  • Only return unique names from mobility_attributes (#256)

0.7.4 (June 8, 2018)

  • Handle locales with multiple dashes in locale accessors, or raise ArgumentError for invalid format (#253)

0.7.3 (June 7, 2018)

  • Fix uniqueness on Mobility model with no translated attributes (#252)

0.7.2 (June 3, 2018)

  • Normalize locale in table aliases (#246)

0.7.1 (May 30, 2018)

  • Revert unscoping in uniqueness validator (#244)

0.7.0 (May 30, 2018)

  • Restructure querying into plugin (ActiveRecord only) (#216, #225, #222)
  • Support querying on multiple locales at once (#232)
  • Allow passing locale to query methods (#233)
  • Support matches and lower predicate methods (#235)
  • Implement case-insensitive uniqueness validation (#236, #237)
  • Support equality predicates between jsonb nodes (#240)
  • Prefer -> operator when comparing jsonb columns (#241)
  • Define options on subclassed backend class (#218)
  • Add column_affix when configuring options (#217)
  • Use module_eval to define locale_accessors (#219)
  • Improve performance of getters/setters (#220)
  • Do not include Default plugin by default (#223)
  • Add specific attribute types to basic usage example (#228). Thanks thatguysimon!
  • Remove Mobility::Interface (#229)
  • Freeze attributes array (#230)

0.6

0.6.0 (April 26, 2018)

  • Add column_prefix/column_suffix options to hash backends (#200 and #201)
  • Require specifying type for KeyValue backends (#200)
  • Remove table backend index on foreign key alone (#198)
  • Test/cleanup index name truncation in backend generators (#197)
  • Improve translations generators (#196)
  • Enforce null: false constraint on columns consistently (#205)
  • Add extension to find translations in a locale for Table backend (#202)
  • Ignore non-arel nodes in joins_values (#206)
  • Collapse duplicates in array-valued query hash (#207)
  • Remove unneeded anonymous module in backend resetters (#213)
  • Make constants private (#214)
  • Use IN when querying on array values with PG backends (#209)
  • Remove some deprecated methods (#215)
  • Explicitly implement matches/has_locale methods everywhere (#194)
  • Refactor Mobility::Backends::AR::QueryMethods using MobilityWhereChain module (#193)
  • Add missing documentation (#192)

0.5

0.5.1 (March 21, 2018)

  • Fix issues with Dirty plugin in ActiveRecord 5.2.0.rc2 (#166)

0.5.0 (March 16, 2018)

  • Support PostgreSQL json column format as Json backend and dynamically in Container backend (#182 and #184, respectively)
  • Fall through to I18n.fallbacks when defined (#180)
  • Improve comments in Rails initializer (#186)
  • Use pragma comments to freeze strings everywhere (#177)

0.4

0.4.3 (February 18, 2018)

  • Add missing require in container backend (#174)
  • Update dependencies to support i18n v1.0
  • Use locale: true instead of fallback: false in dirty plugin (a52998)

0.4.2 (January 29, 2018)

  • Refactor find_by for translated attributes (#160)

0.4.1 (January 29, 2018)

  • Use element operator instead of contains for jsonb querying (#159)

0.4.0 (January 24, 2018)

  • Add new jsonb Container backend (#157)
  • Define attributes accessors with eval (#152)
  • Rename default_fallbacks to new_fallbacks / fallbacks_generator= (#148)
  • Warn user if case_sensitive option is passed to ActiveRecord uniqueness validator (#146)
  • Handle array of values to translated attribute query (#128)
  • Use module builder instance to define shared methods in closure (#130)
  • Query on translated json value with Sequel ORM (#155)
  • Refactor pg query methods (#129)
  • Reduce object allocations (#156)

0.3

0.3.6 (December 25, 2017)

  • Make _read_attribute public in AR Dirty plugin (#150)

0.3.5 (December 24, 2017)

  • Make Default plugin handle Procs more gracefully (#137)
  • Show deprecation warning if keyword options passed to Default plugin (#147)

0.3.4 (December 6, 2017)

  • Move translated_attribute_names to Mobility::ActiveRecord (#132)
  • Refactor AR pg query methods (#129)

0.3.3 (December 5, 2017)

  • Fix duping for AR KeyValue backend (#126)
  • Pass locale and options to Proc in default plugin (#122)

0.3.2 (December 1, 2017)

  • Fix issue with querying on translated attributes with Sequel Table backend (#121)

0.3.1 (December 1, 2017)

  • Disable AR::Dirty method overrides for AR >= 5.2 (and < 5.1 for has_attribute) (#120)

0.3.0 (November 30, 2017)

  • dup support for table backend (#84). Thanks @pwim!
  • Disable fallbacks when using locale/fallthrough accessors (#86, #87, #88, #89)
  • Convert AttributeMethods to plugin (#102)
  • Ensure cache_key is invalidated when updating translations (#104) Thanks @pwim!
  • Update dependency versions (#107)
  • Fix AM/AR Dirty plugin issues with Rails 5.2 (#116)
  • Support new AR::Dirty methods (#111)
  • Use public_send in LocaleAccessors plugin (#117)
  • Deprecate setting value of default_options directly (#113)

0.2

0.2.3 (September 14, 2017)

  • Fix inheritance error when inheriting (#83). Thanks pwim!

0.2.2 (August 23, 2017)

  • Set default values in Sequel Jsonb/Hstore backends (#80)

0.2.1 (August 20, 2017)

  • Fix missing requires in Mobility::Backends::Sequel::PgHash (22df29)
  • Only require Rails generators if both Rails and ActiveRecord are loaded (03a9ff)

0.2.0 (August 13, 2017)

See overview of the changes in this blog post.

  • Mobility.default_options (#50)
  • Re-organized options under Plugins namespace (#62)
  • Backends are now Enumerable (#71)
  • Replace autoload by require (#65)
  • Remove mobility/core_ext and replace with Mobility::Util (#60)
  • New "default" plugin which sets a default value or proc for an attribute: (#49)
  • Add super option (#62)
  • Rename default associations for KeyValue and Table backends (#59 and #66)
  • Refactor cache code (#57)
  • Gem is now signed (#73)
  • Minimum Ruby version: 2.2.7

0.1

0.1.20 (July 23, 2017)

  • Fix location of Rails generators to work with plugins (#56)

0.1.19 (July 16, 2017)

  • Partial support for AR 4.2 (#46)
  • Fix issues with Sequel >= 4.46.0 (#47)
  • Include anonymous modules instead of defining methods directly on class (049a5f, d8fe42, 9cc3d0)

0.1.18 (June 21, 2017)

  • Fix deprecation warnings when using ActiveRecord 5.1 (#44)

0.1.17 (June 16, 2017)

  • Fix STI issues (#43)

0.1.16 (May 29, 2017)

  • Fix deprecation warnings using class_name (#32)
  • Avoid using respond_to? on relation, to fix ImmutableRelation exception (d3e974).

0.1.15 (May 21, 2017)

  • Add support for uniqueness validation (#28)
  • Inherit translated attributes in subclasses (#30)

0.1.14 (April 27, 2017)

  • Reset memoized backends when duplicating (#26)

0.1.13 (April 19, 2017)

  • Allow passing cache: false to disable cache in getter (b4858a) and setter (6085d7)
  • Rename configure! method to configure (4e35c54)
  • Make query scope method configurable (#22)
  • Do not memoize scopes/datasets (#24)

0.1.12

  • Extract presence filter into Mobility::Backend::Presence class (7d654, e42ee6)
  • Get suffix methods from ActiveModel (for compatibility with Rails 4.2) (9685d1)
  • Destroy all translations after model is destroyed (KeyValue backend) (#15)
  • Refactor to remove mobility_get, mobility_set. mobility_present? models from model class (#16)

0.1.11

  • Add backend-specific translations generator (rails generate mobility:translations) (9dbe4d, 583a51, 6b9605, e2e807)
  • Fix bug with combination of Column backend and fallthrough accessors (212f07)
  • Raise InvalidLocale when getting a locale that is not available (d4f0ee)
  • Pass options to backend write from setter (5d224f)
  • Correctly include FallthroughAccessors module in module, not backend (d9471d)
  • Handle presence methods in FallthroughAccessors (66f630)

0.1.10

  • Fix fallback options (#12 and 09a163)
  • Include fallbacks module by default (#13)

0.1.9

(yanked)

0.1.8

(yanked)

0.1.7

  • Allow passing fallback locale or locales to getter method (#9)
  • Add missing indices on key-value string/text translation tables (1e00e0, 574172)

0.1.6

  • Return accessor locales instead of Proc from default_accessor_locales (825f75)
  • Fix support for locales in dirty modules (0b40d6)
  • Add FallthroughAccessors for use in dirty modules (#4)
  • Only raise InvalidLocale exception if I18n.enforce_available_locales is true (979c36)

0.1.5

  • Add accessor_method to default initializer (d4a9da)
  • Include AR version in generated migrations (ac3dfb)
  • Add untranslated_attributes method (50e97f)
  • Do not require active_support/core_ext/nil (39e245)
  • Handle false values correctly when getting and setting (bdf6f1)
  • Use proc to define accessor locales from I18n.available_locales (3cd786)
  • Do not mark attribute as changed if value is the same (fixed in #2)
  • Pass on any args to original reload method when overriding (fixed in #3)

0.1.4

0.1.3

  • Add homepage to gemspec
  • Pass backend class as context to translates (adf93e)

0.1.2

  • Fix issues with querying in ActiveRecord jsonb and hstore backends (527908 and 5e6add)