Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignore_columns integration #97

Closed
palkan opened this issue Nov 20, 2018 · 3 comments
Closed

Add ignore_columns integration #97

palkan opened this issue Nov 20, 2018 · 3 comments

Comments

@palkan
Copy link
Owner

palkan commented Nov 20, 2018

From: #89 (comment)

The idea is the following: we want to reduce the data loaded from DB by not loading log_data column by default (using ignored_columns feature), and only load log_data when explicitly specified (e.g. via with_log_data scope).

The proposed API:

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

(optional, maybe, another PR) Add an easier way to access log_data on a single record, e.g.:

user = User.find(params[:id])
user.log_data #=> raises (or nil?) since column is ignored
user.log_data! #=> loads log_data from DB
@palkan
Copy link
Owner Author

palkan commented Nov 20, 2018

^ FYI @igas

@igas
Copy link

igas commented Nov 20, 2018

O.o I don’t use logidze. It’s probably @noma4i who spoke with you on RubyConf

@palkan
Copy link
Owner Author

palkan commented Nov 20, 2018

O.o I don’t use logidze. It’s probably @noma4i who spoke with you on RubyConf

oops) sorry 🤦‍♂️ Yep, it was him) thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants