Skip to content

0.7.0

Compare
Choose a tag to compare
@palkan palkan released this 29 Aug 16:41
· 208 commits to master since this release

Features

  • Added support for storing meta information along with changes logs (PR #79)

Example:

Logidze.with_meta(ip: request.ip) { post.save }

puts post.meta # => { 'ip' => '95.66.157.226' }

This change requires Logidze DB functions upgrade:

rails generate logidze:install --update
rake db:migrate

This feature replaces the implementation of with_responsible: now responsible_id is stored inside the meta hash with the key _r.

There is fallback to the old data structure ({ 'r' => 42 } opposed to { 'm' => { '_r' => 42 } } in the current implementation), so responsible_id should work as usual for the existing data.

If you access the value manually (e.g. post.log_data.current_version.data['r']), you have to add the fallback by yourself.