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 35 def [](c) 36 (@accessed_columns ||= {})[c] = true unless frozen? 37 super 38 end
accessed_columns()
click to toggle source
The columns that have been accessed.
# File lib/sequel/plugins/accessed_columns.rb 47 def accessed_columns 48 @accessed_columns ? @accessed_columns.keys : [] 49 end
after_save()
click to toggle source
Clear the accessed columns when saving.
Calls superclass method
# File lib/sequel/plugins/accessed_columns.rb 41 def after_save 42 super 43 @accessed_columns = nil 44 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 52 def initialize_copy(other) 53 other.instance_variable_set(:@accessed_columns, Hash[@accessed_columns]) if @accessed_columns 54 super 55 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 60 def _refresh(_) 61 @accessed_columns = nil 62 super 63 end