Module: Sequel::Plugins::AccessedColumns::InstanceMethods
- Defined in:
- lib/sequel/plugins/accessed_columns.rb
Instance Method Summary collapse
-
#[](c) ⇒ Object
Record the column access before retrieving the value.
-
#accessed_columns ⇒ Object
The columns that have been accessed.
-
#after_save ⇒ Object
Clear the accessed columns when saving.
-
#initialize_copy(other) ⇒ Object
Copy the accessed columns when duping and cloning.
Instance Method Details
#[](c) ⇒ Object
Record the column access before retrieving the value.
31 32 33 34 |
# File 'lib/sequel/plugins/accessed_columns.rb', line 31 def [](c) (@accessed_columns ||= {})[c] = true unless frozen? super end |
#accessed_columns ⇒ Object
The columns that have been accessed.
43 44 45 |
# File 'lib/sequel/plugins/accessed_columns.rb', line 43 def accessed_columns @accessed_columns ? @accessed_columns.keys : [] end |
#after_save ⇒ Object
Clear the accessed columns when saving.
37 38 39 40 |
# File 'lib/sequel/plugins/accessed_columns.rb', line 37 def after_save super @accessed_columns = nil end |