Module: MakeTaggable::Taggable::Cache::Columns
- Defined in:
- lib/make_taggable/taggable/cache.rb
Overview
Intercepts the model's column lookup so caching can be wired up the first time the schema is known, without opening a database connection when the class is loaded.
Instance Method Summary collapse
-
#columns ⇒ Array<ActiveRecord::ConnectionAdapters::Column>
The model's columns, injecting the caching methods the first time they are asked for.
-
#reset_column_information ⇒ void
Forgets the cached column lookup along with Active Record's own.
Instance Method Details
#columns ⇒ Array<ActiveRecord::ConnectionAdapters::Column>
The model's columns, injecting the caching methods the first time they are asked for.
37 38 39 40 41 42 43 |
# File 'lib/make_taggable/taggable/cache.rb', line 37 def columns @make_taggable_cache_columns ||= begin db_columns = super if (db_columns) db_columns end end |
#reset_column_information ⇒ void
This method returns an undefined value.
Forgets the cached column lookup along with Active Record's own.
50 51 52 53 |
# File 'lib/make_taggable/taggable/cache.rb', line 50 def reset_column_information super @make_taggable_cache_columns = nil end |