Public Instance methods
[](c)
Record the column access before retrieving the value.
[show source]
# File lib/sequel/plugins/accessed_columns.rb 35 def [](c) 36 (@accessed_columns ||= {})[c] = true unless frozen? 37 super 38 end
accessed_columns()
The columns that have been accessed.
[show source]
# File lib/sequel/plugins/accessed_columns.rb 47 def accessed_columns 48 @accessed_columns ? @accessed_columns.keys : [] 49 end
after_save()
Clear the accessed columns when saving.
[show source]
# File lib/sequel/plugins/accessed_columns.rb 41 def after_save 42 super 43 @accessed_columns = nil 44 end
initialize_copy(other)
Copy the accessed columns when duping and cloning.
[show source]
# File lib/sequel/plugins/accessed_columns.rb 52 def initialize_copy(other) 53 other.instance_variable_set(:@accessed_columns, Hash[@accessed_columns]) if @accessed_columns 54 super 55 end