Store twitter_id on the database #14

Open
wants to merge 4 commits into
from

Projects

None yet

1 participant

@amuino
amuino commented Oct 7, 2010

If the twitter_id column exists on the model, it will be populated with twitter's user_id.

This patch updates both the collection of the twitter_id and the migration templates.

Twitter API supports the trim_user=true option which only returns the numeric user_id for the user information (instead of the full info, which can be redundant and add unneeded parsing/network overhead)

amuino added some commits Oct 7, 2010
@amuino amuino Allow capturing the twitter user id during signup and connect. This i…
…s specially useful when using trim_user=true parameter on calls to the twitter API.
611439a
@amuino amuino Use twitter user_id when looking up existing users instead of twitter…
…_handle.

Twitter_handle can now be optional.
Update twitter_handle if changed since the previous connect/signup
UNTESTED: As far as I can tell, queries use a Mongoid-compatible syntax.
4f07a62
@amuino
amuino commented Oct 7, 2010

Additional commit for issue http://github.com/MSch/devise-twitter/issues#issue/12 , including updating the twitter_handle on connect/signup (and making it optional on the model)

It should also address Mongoid compatibility (a different approach than used by jtoy, which didn't work for me with Rails3+Arel)

amuino added some commits Oct 8, 2010
@amuino amuino Lookup users by twitter_id on signup, instead of by oauth_credentials…
…. This allows linking with users we already known because we saw them on other user's timeline (for instance).

In this case, we also need to update the oauth_credentials.
53537df
@amuino amuino Updated readme 6f9a565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment