Skip to content

0.9.0

Compare
Choose a tag to compare
@palkan palkan released this 28 Nov 16:23
· 195 commits to master since this release

Features

  • Added #reload_log_data to fetch the actual log_data from DB.
user = User.create!(params)
user.log_data #=> nil, 'cause it's generated DB-side

user.reload_log_data
user.log_data #=> Logidze::History
  • Added :ignore_log_data option to #has_logidze to avoid selecting log_data by default.

Usage:

class User < ActiveRecord::Base
  has_logidze ignore_log_data: true
end

User.all #=> SELECT id, name FROM users

User.with_log_data #=> SELECT id, name, log_data FROM users

user = User.find(params[:id])
user.log_data #=> ActiveModel::MissingAttributeError

user.reload_log_data #=> Logidze::History