PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/CHANGELOG.md

https://github.com/mongomapper/mongomapper
Markdown | 320 lines | 234 code | 86 blank | 0 comment | 0 complexity | 290ced01e49c010a6910264aff6da80c MD5 | raw file
  1. <!--
  2. ## HEAD
  3. ### Enhancements:
  4. ### Bug Fixes:
  5. ### Doc Fixes:
  6. -->
  7. ## 0.15.4 - 2021-06-18
  8. ### Enhancements:
  9. * PR-680 and PR-685 Masato Ikeda <masato.ikeda@gmail.com> Support Ruby 3.0
  10. ## 0.15.3 - 2021-02-11
  11. ### Bug Fixes:
  12. * PR-677 Masato Ikeda <masato.ikeda@gmail.com> Reload proxy target for stale nil target on `belongs_to` associations.
  13. ```ruby
  14. child = Child.create!(parent: nil)
  15. child.parent_id = Parent.create!.id
  16. p child.parent #=> nil
  17. ```
  18. ## 0.15.2 - 2021-01-31
  19. ### Enhancements:
  20. * PR-662 Masato Ikeda <masato.ikeda@gmail.com> Add `__FILE__` and `__LINE__` to accessor definitions
  21. * PR-668 ujihisa <ujihisa@users.noreply.github.com> Use GitHub Actions for CI, instead of Travis
  22. * PR-671 ujihisa <ujihisa@users.noreply.github.com> Test against Rails 6.1
  23. ### Bug Fixes:
  24. * PR-663 Fumiaki MATSUSHIMA <mtsmfm@gmail.com> Make active_scopes thread safe
  25. * PR-664 Fumiaki MATSUSHIMA <mtsmfm@gmail.com> Fix one embedded proxy to keep the assigned object (don't reassign it)
  26. * PR-665 Fumiaki MATSUSHIMA <mtsmfm@gmail.com> Proxy shouldn't respond to private method
  27. * PR-666 Masato Ikeda <masato.ikeda@gmail.com> Typecast in-array elements before detecting dirty
  28. * PR-667 ujihisa <ujihisa@users.noreply.github.com> Update dirty before callbacks
  29. * PR-670 ujihisa <ujihisa@users.noreply.github.com> Prohibit defining some scope names that overrides existing methods, such as "private"
  30. * PR-672 Fumiaki MATSUSHIMA <mtsmfm@gmail.com> Avoid caching _root_document
  31. * PR-676 Fumiaki MATSUSHIMA <mtsmfm@gmail.com> Reload belongs to association when foreign key is changed
  32. ## 0.15.1 - 2020-10-03
  33. ### Enhancements:
  34. * PR-649 Chris Heald <cheald@gmail.com> Add StrongParameters plugin. Not included by default.
  35. * PR-615 Kenichi Kamiya <kachick1@gmail.com> Return an Enumerator on #find_each when not given a block
  36. * PR-598 Scott Taylor <scott@railsnewbie.com> Allow incrementing + decrementing using only the field name (example: `obj.increment(:my_counter)`)
  37. * PR-593 Scott Taylor <scott@railsnewbie.com> Add sorting with :ordered => true for has_many :in => :array (Closes #428)
  38. * PR-523 Shevaun Coker <shevaun.coker@gmail.com> Add `assign_attributes` "alias" method for `attributes=`
  39. * PR-259 Hubert <hubert.lepicki@amberbit.com> Add Inverse Many to Many associations. Example:
  40. ```ruby
  41. class List
  42. include MongoMapper::Document
  43. key :name, String, required: true
  44. key :user_ids, Array
  45. many :users, in: :user_ids
  46. end
  47. class User
  48. include MongoMapper::Document
  49. key :name, String, required: true
  50. many :lists, from: :user_ids, as: :user
  51. end
  52. ```
  53. * Support ruby 2.7.2
  54. ### Bug Fixes:
  55. * PR-640 Seth Jeffery <seth@quipper.com> Fix find! with a one item array to return a one item array object
  56. * PR-628 jamieorc <jamieorc@gmail.com> Corrected a regression on Set keys with typecast
  57. * PR-611 SteffanPerry <sperry1988@gmail.com> Missing yaml requirement was throwing error on rail 4.2.1: "uninitialized constant `MongoMapper::Railtie::YAML` (NameError)"
  58. * Add `attributes` to reserved keys
  59. * Fix infinite regression with duplicate assignment to belongs_to proxy
  60. ### Doc Fixes:
  61. * PR-650 Olle Jonsson <olle.jonsson@gmail.com> README: SVG badges
  62. * PR-660 Kenichi Kamiya <kachick1@gmail.com> Fix indent
  63. * PR-617 Kenichi Kamiya <kachick1@gmail.com> Update types to follow Symbol support
  64. * PR-616 Kenichi Kamiya <kachick1@gmail.com> Remove an unused spec
  65. ## 0.15.0 - 2020-09-14
  66. * Upgrade to use modern mongo by upgrading to use the mongo 2.0 driver.
  67. This update means MongoMapper should work with any version of mongo after (2.6+).
  68. Many thanks to Frederick Cheung <frederick.cheung@gmail.com> for his contribution.
  69. Note that MyModel.collection now returns a mongo 2.0 driver collection object which does not mirror the shell methods.
  70. Patches welcome for a compatibility layer!
  71. * Support for ruby 2.4+, rails 5.0+
  72. * Dropping support for all older rubies, older rails.
  73. ## 0.14.0 - 2017-01-19
  74. ## 0.14.0 RC1 - 2016-03-16
  75. ### Enhancements:
  76. * Only partially update objects (using $set and $unset) when updates occur.
  77. Partial Updates can be turned on or off per class (by default they are off):
  78. ```ruby
  79. class Person
  80. include MongoMapper::Document
  81. self.partial_updates = true
  82. end
  83. ```
  84. [smtlaissezfaire]
  85. * (Optionally) allow only static (defined) keys, and raise errors for keys that haven't been defined (mimic Mongoid's allow_dynamic_fields = false).
  86. Turn this on, per model, with:
  87. ```ruby
  88. class Person
  89. include MongoMapper::Document
  90. self.static_keys = true
  91. end
  92. p = Person.new
  93. p['non_defined_key'] = 'foo' # => MissingKeyError
  94. ```
  95. [smtlaissezfaire]
  96. * Add `after_find`, `after_initialize` callbacks [smtlaissezfaire]
  97. ### Bug Fixes
  98. * Fix counter caching with polymorphic belongs_to [smtlaissezfaire, bhernez]
  99. * Fix issues with arrays + plucky query. (upgrade to plucky query 0.7.0 - see regressions in scope_spec.rb)
  100. ### Internals:
  101. * Don't create accessors for reserved keys (id, class, etc) [cheald]
  102. * Disallow class as a key name [cheald]
  103. * Add ruby 1.8.7 specific gem files to use specific version of i18n <poineau@nationbuilder.com>
  104. * Fixing failing tests for rails 4 <poineau@nationbuilder.com>
  105. * Upgrade to rspec 3.x [smtlaissezfaire, sgnn7]
  106. * Officially Drop support for ruby versions < 2.0.x
  107. * Officially Drop support for rails < 3.2
  108. ## 0.13.1 - 2014-11-18
  109. ### Enhancements:
  110. * Add counter caching [smtlaissezfaire]
  111. ```ruby
  112. belongs_to :user, :counter_cache => true
  113. belongs_to :user, :counter_cache => :custom_posts_count
  114. ```
  115. * Add Symbol type [miyucy]
  116. * Add the ability to easily query collection stats: [sgnn7]
  117. ```ruby
  118. MyModel.stats.snake_cased_field
  119. ```
  120. ### Bug Fixes:
  121. * Proxy#send should work with blocks and procs [mgroeneman]
  122. * Support inheriting OneAssociation. [DimaSamodurov]
  123. * write_attribute should return a type casted value [smtlaissezfaire]
  124. * Fix remove_validations_for for AS 4.1 [cpmurphy]
  125. * Fix autosupport loading issue (See rails issue 14664), and add test for ruby 2.1.1 [leifcr]
  126. * Fix syntax error in rescue response declarations for rails < 3.2 was causing MongoMapper::DocumentNotFound exceptions to cause an exception in WebBrick's exception handling in development. [bsoule]
  127. ### Internals:
  128. * Lock rest-client to 1.6.7 to ensure installation on 1.8.7
  129. * Added error message: can't mass assign protected attribute. This should be deprecated for proper protected_attributes support down the road. [ThomasAlxDmy]
  130. * Add a spec to check for extra whitespace in files [rthbound]
  131. ## 0.13.0 - 2014-05-2014
  132. ### Enhancements:
  133. * Rails 4 support! [cheald]
  134. * Added error message: can't mass assign protected attribute [tdmytryk@fanhattan.com]
  135. * Add Integer#from_mongo. [cheald][#533]
  136. * Normalize IDs passed to #find!, so that it may accept an unsplatted array of IDs, just like #find. [cheald][#468][#469].
  137. * Performance Improvements to: typecasting, identity map, etc. (see a60b04c) [cheald]
  138. * Upgrade safe semantics to be consistent with the new MongoClient safe semantics (:safe => true is now on by default) [cheald]
  139. * Various performance fixes mostly related to avoid extraneous method invocation [cheald]
  140. * Optimization: use key? [jnunemaker]
  141. * Added SSL connection support [daniel.becker@me.com]
  142. * Add automatic id generation when not set (for instance, when calling clone). [wpeterson@brightcove.com]
  143. ### Bug Fixes:
  144. * validatior#setup is deprecated in activemodel 4.1 [fcheung]
  145. * Only add the _type key to inherited classes when they have the same collection as their parent. Classes with a different collection name don't need the SCI keys. [cheald]
  146. * remove the _type key when SCI is turned off with set_collection_name. Add specs to cover it. [cheald]
  147. * Key serialization mutates model state when using key Array with option typecast [Oktavilla]
  148. * Be more clear when specifying which version of JRuby mongo_mapper is tested against [tad.hosford@gmail.com]
  149. * Fix db:drop to match everything but system exactly [banyan]
  150. * Fix rescue responses for rails 3.0 and 3.1 [leifrc]
  151. * Use ruby 1.8 syntax for hashes [nigel.ramsay@abletech.co.nz]
  152. * Cast data with loaded from an embedded proxy, as embedded proxies may receive their values from uncast sources. [cheald][#536]
  153. * Permit suppression of accessor methods via the :accessors option to #key. [cheald][#535]
  154. * Guard against failures when the keys are read or written during a hijacked #initialize before we've gotten to run our own #initialize. [pluginaweek][#531]
  155. * When performing Time#to_mongo, round times off to milliseconds and discard microseconds. [cheald][#455]
  156. * Permit the use of #insert and #update in addition to #save, so that we can catch and raise errors in safe mode. [cheald][#398].
  157. * Add critera_hash when single collection inherited. [cheald][#454]
  158. * Fix issues with set_collection_name nullifying SCI on 1.8 [cheald]
  159. * Disable SCI when an inherited model explicitly changes its collection. Closes [cheald][#396]
  160. * Validate key names. Explicitly disallow keys named `id` since they aren't reachable via plucky due to key normalization. Validate key names via regex. [cheald][#399].
  161. * Don't attempt to create a connection when inheriting classes if one does not already exist. [cheald][#460]
  162. * Accept blocks passed to new/build/create/create! on documents and associations. [cheald][#352]
  163. * Compact before setting embedded docs on a many association. [cheald][#288]
  164. * Limit subclass scopes to subclasses. [cheald][#512]
  165. * Update bundler and fix mocha dependency [josevalim]
  166. * Fix Ruby 2.0 breakage caused by behavior changes to #respond_to? [cheald][#473]
  167. * Don't iterate the whole cursor twice when using IdentityMap with #all. Improve performance by avoiding explicit block bindings, extraneous method calls, and extraneous array creation. [cheald]
  168. * Provide a fix for many associations not yielding to each in callbacks. [jnunemaker]
  169. * Support non-ObjectID ids being given to modifiers. [jnunemaker]
  170. * Inherit connection and database name. Subclasses were not getting these before. Only collection name was inherited. [jnunemaker][#420][#424]
  171. ### Internals:
  172. * Update travis to test on 2.1.1 [leifcr]
  173. * Do not mutate model values using key with typecast [joel.junstrom@oktavilla.se]
  174. * Setting a key using send should return the new value [tjwp-yesware]
  175. * docs fixes [KristineHines, lucianosousa]
  176. * Lock timecop to 0.6.1 for Ruby 1.8.7 support [cheald]
  177. * Bump plucky requirement to 0.6.5 [cheald]
  178. * Add #dynamic_keys and #defined_keys to let developers distinguish defined schema from derived schema. Use a less clever idiom for 1.8-compatible hash filtering. [cheald]
  179. * Add key aliasing [cheald]
  180. * mongo driver requires that read preference to be type of symbol [foxban@gmail.com]
  181. * changed deleted cursor.next_object method to cursor.next [jamesbowles]
  182. * Use ||= idiom [tn.pablo@gmail.com]
  183. * Update to latest plucky. [nunemaker]
  184. * Added record_timestamps class var to the timestamps plugin [kamil.bednarz@u2i.com]
  185. * reverse_merge! -> reverse_merge [nviennot]
  186. * Some source files were executable [nicolas@viennot.biz]
  187. * Fix legacy mongo class names, that are in deprecation as of 1.8.0. [archSeer]
  188. * move delete and destroy methods to Querying::Decorator [balexand@gmail.com]
  189. * Improvements to key methods (see 942003cca2)[cheald]
  190. * Fix travis suport [wpeterson@brightcove.com]
  191. ## 0.12.0 - 2012-09-12
  192. * Identity map is now more opt-in. Middleware turns it on, but it stays off for background jobs and such without explicit intervention.
  193. * Update to latest version of plucky
  194. * Rails 3.2 support
  195. * Support new mongo hosts option format
  196. * A few bug fixes
  197. ## 0.11.1 - 2012-03-30
  198. ### Enhancements:
  199. * Add ActiveRecord-style #touch to documents and associations
  200. * Add options to atomic modifiers that are passed to the driver
  201. ```ruby
  202. Page.increment({:title => "Hello World"}, {:comment_count => 1}, {:upsert => true})
  203. ```
  204. ### Bug Fixes:
  205. * Stop raising error if MongoMapper.database is nil
  206. * Delegate `:distinct`, `:size`, `:reverse`, `:offset`, `:order`, `:empty?`,
  207. `:filter`, `:find_one`, `:per_page`, `:ignore`, `:only`, and `:to_a` on
  208. Document to query
  209. * Fix for `EmbeddedDocument#inspect` [#373]
  210. * Ensure milliseconds are preserved with time values [#308]
  211. * Allow MongoMapper.setup to accept a symbol for the environment name
  212. https://github.com/mongomapper/mongomapper/compare/v0.11.0...v0.11.1
  213. ## 0.11.0 - 2012-01-26
  214. ### Enhancements:
  215. * Adds support for `has_one` polymorphic embedded associations
  216. * Adds namespacing to model generator
  217. * Adds `:context` option to validates_associated
  218. ```ruby
  219. many :things
  220. validates_associated :things, :context => :custom_context
  221. ```
  222. * Adds ActiveRecord-compatible association reflection
  223. * Adds support for setting mongo connection options in `mongo.yml`
  224. ```yaml
  225. production:
  226. uri: <%= ENV['MONGOHQ_URL'] %>
  227. options:
  228. safe: true
  229. ```
  230. * Adds `#timestamps!` to embedded documents
  231. ### Bug Fixes
  232. * `#update_attribute` now ignores attr_accessible and attr_protected
  233. * Fix deprecation warnings in Rails 3.2
  234. https://github.com/jnunemaker/mongomapper/compare/v0.10.1...v0.11.0