module Sequel::Plugins::AccessedColumns::InstanceMethods
Public Instance Methods
[](c)
click to toggle source
Record the column access before retrieving the value.
Calls superclass method
# File lib/sequel/plugins/accessed_columns.rb 31 def [](c) 32 (@accessed_columns ||= {})[c] = true unless frozen? 33 super 34 end
accessed_columns()
click to toggle source
The columns that have been accessed.
# File lib/sequel/plugins/accessed_columns.rb 43 def accessed_columns 44 @accessed_columns ? @accessed_columns.keys : [] 45 end
after_save()
click to toggle source
Clear the accessed columns when saving.
Calls superclass method
# File lib/sequel/plugins/accessed_columns.rb 37 def after_save 38 super 39 @accessed_columns = nil 40 end
initialize_copy(other)
click to toggle source
Copy the accessed columns when duping and cloning.
Calls superclass method
# File lib/sequel/plugins/accessed_columns.rb 48 def initialize_copy(other) 49 other.instance_variable_set(:@accessed_columns, Hash[@accessed_columns]) if @accessed_columns 50 super 51 end
Private Instance Methods
_refresh(_)
click to toggle source
Clear the accessed columns when refreshing.
Calls superclass method
# File lib/sequel/plugins/accessed_columns.rb 56 def _refresh(_) 57 @accessed_columns = nil 58 super 59 end