Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created May 31, 2011 06:50
Show Gist options
  • Save ukstudio/1000079 to your computer and use it in GitHub Desktop.
Save ukstudio/1000079 to your computer and use it in GitHub Desktop.
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