11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/acts_as_entity/base.rb', line 11
def acts_as_entity(entityDef,options = {})
after_initialize :setAttrs
class << self
alias_method :find_entities, :find
end
include ActiveRecord::ActsAsEntity::InstanceMethods
instance_eval " public\n def find(args)\n find_entities(args, :conditions => \"entity_def_id = '\#{entityDef}' \")\n end\n def all\n find_entities(:all, :conditions => \"entity_def_id = '\#{entityDef}' \" )\n end\n DEFINE_METHODS\nend\n"
|