Class: RTM::AR::Association

Inherits:
Reifiable show all
Includes:
Sugar::Association::HashAccess, Sugar::Role::Counterparts, RTM::Association
Defined in:
lib/rtm/activerecord/association_and_role.rb,
lib/rtm/activerecord.rb

Instance Method Summary collapse

Methods included from Sugar::Role::Counterparts

#counterpart, #counterparts, #counterplayer, #counterplayers, #peerplayers, #peers

Methods included from Sugar::Association::HashAccess

#[]

Methods included from Construct

#find

Methods inherited from Reifiable

abstract_class?

Methods inherited from Construct

abstract_class?, find, wrap

Methods inherited from TMDelegator

#__getobj__, #__setobj__, aka_property, class_delegate, delegate, #eql?, equality, #hash, #initialize, parent, property, property_set, wrapper_cache

Constructor Details

This class inherits a constructor from RTM::AR::TMDelegator

Instance Method Details

#filter_roles(*args) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/rtm/activerecord/association_and_role.rb', line 29

def filter_roles(*args)
  if args.size == 1
    t = topic_map.get(args.first)
    return self.roles.find(:all,:conditions => ["ttype_id = ?", t.__getobj__.id])
  end
  false
end

#idObject



23
24
25
# File 'lib/rtm/activerecord/association_and_role.rb', line 23

def id
  __getobj__.id
end