Support mixin for models subclassed from ActiveRecord::Base providing a core out-of-box Hoodoo data access security model. See Hoodoo::ActiveRecord::Secure::ClassMethods#secure for details.

See also:

Namespace
Methods
I
Constants
OBJECT_EQLS_STAR =
Hoodoo::ActiveRecord::Secure::SecurityHelper::eqls_wildcard( '*' )
 

Convenience constant defining an equals-single-security-value wildcard security exemption using the String '*'.

ENUMERABLE_INCLUDES_STAR =
Hoodoo::ActiveRecord::Secure::SecurityHelper::includes_wildcard( '*' )
 

Convenience constant defining an included-in-enumerable-security-value wildcard security excemption using the String '*'.

Class Public methods
included( model )

Instantiates this module when it is included.

Example:

class SomeModel < ActiveRecord::Base
  include Hoodoo::ActiveRecord::Secure
  # ...
end
model

The ActiveRecord::Base descendant that is including this module.

# File lib/hoodoo/active/active_record/secure.rb, line 39
def self.included( model )
  model.class_attribute(
    :nz_co_loyalty_hoodoo_secure_with,
    {
      :instance_predicate => false,
      :instance_accessor  => false
    }
  )

  instantiate( model ) unless model == Hoodoo::ActiveRecord::Base
  super( model )
end
instantiate( model )

When instantiated in an ActiveRecord::Base subclass, all of the Hoodoo::ActiveRecord::Secure::ClassMethods methods are defined as class methods on the including class.

model

The ActiveRecord::Base descendant that is including this module.

# File lib/hoodoo/active/active_record/secure.rb, line 59
def self.instantiate( model )
  model.extend( ClassMethods )
end