module ActiveFacets
TODO –jdc, change serializer scoped_includes, as_json & from_hash to be generic and add voerrides in initializer for www
when serializing, access cattr to determine method name to invoke
add tests for the this module
Field Set Alias = Symbol representing a Field Set
This is a really dump cache interface that caches everything Extend with custom class that conditionally caches and stitches independent documents
TODO –jdc comment this class
TODO –jdc rebuild this class to either not use an explicit singleton pattern or use a factory pattern
Constants
- VERSION
Public Class Methods
configure() { |self| ... }
click to toggle source
# File lib/active_facets.rb, line 53 def self.configure yield(self) ActiveRecord::Base.acts_as_active_facet if ActiveFacets.acts_as_active_facet_enabled end
deep_copy(o)
click to toggle source
# File lib/active_facets.rb, line 88 def self.deep_copy(o) Marshal.load(Marshal.dump(o)) end
fields_from_options(options)
click to toggle source
# File lib/active_facets.rb, line 70 def self.fields_from_options(options) (options[ActiveFacets.opts_key] || {})[ActiveFacets.fields_key] end
global_filter(name)
click to toggle source
# File lib/active_facets.rb, line 58 def self.global_filter(name) ActiveFacets::Filter.register_global(name, Proc.new) end
options_with_fields(options, fields)
click to toggle source
# File lib/active_facets.rb, line 74 def self.options_with_fields(options, fields) (options[ActiveFacets.opts_key] ||= {})[ActiveFacets.fields_key] = fields options end
resource_mapper()
click to toggle source
# File lib/active_facets.rb, line 62 def self.resource_mapper ActiveFacets::ResourceManager.resource_mapper = Proc.new end
restore_opts_after(options, key, value) { || ... }
click to toggle source
# File lib/active_facets.rb, line 79 def self.restore_opts_after(options, key, value) opts = (options[ActiveFacets.opts_key] ||= {}) old = opts[key] opts[key] = value yield ensure opts[key] = old end
serializer_mapper()
click to toggle source
# File lib/active_facets.rb, line 66 def self.serializer_mapper ActiveFacets::ResourceManager.serializer_mapper = Proc.new end