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 <<-DEFINE_METHODS
public
def find(args)
find_entities(args, :conditions => "entity_def_id = '#{entityDef}' ")
end
def all
find_entities(:all, :conditions => "entity_def_id = '#{entityDef}' " )
end
DEFINE_METHODS
end
|