mongoid / mongoid-history

Multi-user non-linear history tracking, auditing, undo, redo for mongoid.
https://rubygems.org/gems/mongoid-history
MIT License
393 stars 129 forks source link

Add helper to track all embedded relations. #172

Closed jnfeinstein closed 8 years ago

jnfeinstein commented 8 years ago

I think this was already in the works given the deprecation warning when 'on' is set to 'all'. Adding 'fields' already triggers on all of the fields of the model, now adding 'relations' will do the same for all embedded relations. ['fields', 'relations'] should perform the desired future behavior of 'all'.

dblock commented 8 years ago

This needs to be documented in README I think. And fix the build please, rubocop -a.

johnnyshields commented 8 years ago

@JagdeepSingh your comments here?

jnfeinstein commented 8 years ago

@dblock will fix rubocop. I did not add to README because the :fields helper is also not included in the README.

jnfeinstein commented 8 years ago

Updated w/ rubocop fixes.

jagdeepsingh commented 8 years ago

Looks okay to me. Just that :relations may be confusing for users. It will only track the embedded relations, not any other relation in the class. So, may be rename on: :relations to on: :embedded_relations or something. And/or have a clear documentation in the README about it.

jnfeinstein commented 8 years ago

@JagdeepSingh updated per your suggestion.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.0006%) to 99.738% when pulling 7f56758ec8416bd1f0de022a87b9751d024d2f74 on jnfeinstein:relations into 4a69aec69b633cd0eaaee221fe7c4b1234434ff5 on mongoid:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.0006%) to 99.738% when pulling 7f56758ec8416bd1f0de022a87b9751d024d2f74 on jnfeinstein:relations into 4a69aec69b633cd0eaaee221fe7c4b1234434ff5 on mongoid:master.

dblock commented 8 years ago

Still needs a README update otherwise looks great.

jnfeinstein commented 8 years ago

@dblock updated. I added a blurb on the :fields helper since that was also not documented.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.0006%) to 99.738% when pulling 8d1aae349ebc6fefefad026ae9a2e45fbad2003d on jnfeinstein:relations into 4a69aec69b633cd0eaaee221fe7c4b1234434ff5 on mongoid:master.

dblock commented 8 years ago

Great, merged, Thanks!