Hello Ruby users,
I am stuck with the following problem:
I have an access control list system, with multiple group, section and
base classes. There are several section types (AroSection, AxoSection,
AclSection etc.), several group types (AxoGroup, AroGroup) and several
base Types (Acl, Axo, Aro, Aco).
These share some common funcionality that only differs by name of the
class AclSection < ActiveRecord::Base
has_many :acls, :dependent => true validates_presence_of :name, :value validates_numericality_of :order_value validates_uniqueness_of :value def instance_method_for_acl (would be the same functionality for the
acls.each do |acl|
Is it possible to do some refactoring, so I only have to define my code
once and the method names get used from some parameter or extracted from
the class name?