Created
          May 31, 2011 06:50 
        
      - 
      
- 
        Save ukstudio/1000079 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class UserList < ActiveRecord::Base | |
| # user_id ログインしてる人 | |
| # facebook_user_id userlist.yamlのIDと同じ | |
| # name userlist.yamlのnameと同じ | |
| # enable userlist.yamlのenableと同じ | |
| end | |
| class MyUserList | |
| def initialize(id) | |
| @id = id | |
| @lists = UserList.where(:user_id => id) | |
| end | |
| def alias(user_id, name) | |
| @lists.find_by_facebook_user_id(user_id).update_attributes(:name => name) | |
| end | |
| end | |
| mylist=MyList.new(my_user_id) | |
| mylist.alias(tyoro_id, 'tyoro') | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment