It would be cool if I could use belongs_to to link my own models to facebook''s models (e.g. if I could have a table "cool_people" belongs_to a facebook group/gid). Generally speaking it would be nice if facebooker''s models worked more like traditional ActiveRecord objects, for example event.members instead of calling session.event_members(eid). --simon -- http://simonwoodside.com
Some of the objects already work this way. For instance, there is an albums method on User which deals with loading the right albums. Unfortunately, Facebook''s terms of service prohibit storing most of the API information, so storing information in a table isn''t allowed. Mike On Mar 2, 2008, at 4:38 PM, S. Woodside wrote:> It would be cool if I could use belongs_to to link my own models to > facebook''s models (e.g. if I could have a table "cool_people" > belongs_to a facebook group/gid). Generally speaking it would be nice > if facebooker''s models worked more like traditional ActiveRecord > objects, for example event.members instead of calling > session.event_members(eid). > > --simon > > -- > http://simonwoodside.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
I realize it''s still early days! I''m thinking about a direction I think it would be good to go in in general with Facebooker. So right now I might do something like this: @event = @fb_sess.events( :eid => my_id ).first # Array of Attendance: @invited_users = @ fb_sess.event_members( @event.eid ) <%= fb_name @invited_users.first.uid %> Whereas a more "rails" way to do it would be: # Automatically accesses my session in a class method: @event = Facebooker::Event( :eid => my_id ).first # here Event has_many members (Users): @invited_users = @event.members # fb_name understands User object: <%= fb_name @invited_users.first %> It''s farther away from the facebook PHP model but more railsy and I think easier to code with. --simon PS For storing local information, I don''t get why that matters here, you can cache for up to 24 hours and if the cache is expired, just transparently reload the data from facebook. PPS I guess that I''m not talking about actually mirroring FB''s data here into local models, but "faking it out" somehow to make it seem like its more active recordsy -- http://simonwoodside.com On Mar 2, 2008, at 6:09 PM, Mike Mangino wrote:> Some of the objects already work this way. For instance, there is > an albums method on User which deals with loading the right albums. > Unfortunately, Facebook''s terms of service prohibit storing most of > the API information, so storing information in a table isn''t allowed. > > Mike > > On Mar 2, 2008, at 4:38 PM, S. Woodside wrote: > >> It would be cool if I could use belongs_to to link my own models to >> facebook''s models (e.g. if I could have a table "cool_people" >> belongs_to a facebook group/gid). Generally speaking it would be nice >> if facebooker''s models worked more like traditional ActiveRecord >> objects, for example event.members instead of calling >> session.event_members(eid). >> >> --simon >> >> -- >> http://simonwoodside.com >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > >
We would love patches to do that. You can take a look at how user implement albums. Mike On Mar 2, 2008, at 9:01 PM, S. Woodside wrote:> I realize it''s still early days! I''m thinking about a direction I > think it would be good to go in in general with Facebooker. > > So right now I might do something like this: > > @event = @fb_sess.events( :eid => my_id ).first > # Array of Attendance: > @invited_users = @ fb_sess.event_members( @event.eid ) > <%= fb_name @invited_users.first.uid %> > > Whereas a more "rails" way to do it would be: > > # Automatically accesses my session in a class method: > @event = Facebooker::Event( :eid => my_id ).first > # here Event has_many members (Users): > @invited_users = @event.members > # fb_name understands User object: > <%= fb_name @invited_users.first %> > > It''s farther away from the facebook PHP model but more railsy and I > think easier to code with. > > --simon > > PS For storing local information, I don''t get why that matters here, > you can cache for up to 24 hours and if the cache is expired, just > transparently reload the data from facebook. > > PPS I guess that I''m not talking about actually mirroring FB''s data > here into local models, but "faking it out" somehow to make it seem > like its more active recordsy > > -- > http://simonwoodside.com > > > On Mar 2, 2008, at 6:09 PM, Mike Mangino wrote: > >> Some of the objects already work this way. For instance, there is >> an albums method on User which deals with loading the right albums. >> Unfortunately, Facebook''s terms of service prohibit storing most of >> the API information, so storing information in a table isn''t allowed. >> >> Mike >> >> On Mar 2, 2008, at 4:38 PM, S. Woodside wrote: >> >>> It would be cool if I could use belongs_to to link my own models to >>> facebook''s models (e.g. if I could have a table "cool_people" >>> belongs_to a facebook group/gid). Generally speaking it would be >>> nice >>> if facebooker''s models worked more like traditional ActiveRecord >>> objects, for example event.members instead of calling >>> session.event_members(eid). >>> >>> --simon >>> >>> -- >>> http://simonwoodside.com >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >>-- Mike Mangino http://www.elevatedrails.com