Sha256: 4cdb24c7c2afb99749d6f1ed9d5a962b4c7c2da2e29f46e48cb0d78a695e2478
Contents?: true
Size: 508 Bytes
Versions: 15
Compression:
Stored size: 508 Bytes
Contents
class Sfn::Person < Sfn::Resource attributes :name, :id, :photo, :tagline def path "/people/#{@id}" end def setup_associations has_many :replies, :url => "#{path}/replies" has_many :topics, :url => "#{path}/topics" has_many :followed_topics, :url => "#{path}/followed/topics", :class_name => 'Sfn::Topic' end end class Me < Sfn::Person def path loaded? ? super : "/me" end def was_loaded(result) @id = self.attributes["id"] setup_associations end end
Version data entries
15 entries across 15 versions & 3 rubygems