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 User < ActiveRecord::Base | |
| attr_accessible :name | |
| has_many :admin_memberships, class_name: "Membership", conditions: {role: 'admin'} | |
| has_many :editor_memberships, class_name: "Membership", conditions: {role: 'editor'} | |
| def admin? | |
| admin_memberships.exists? | |
| end |
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
| import urlparse | |
| import oauth2 as oauth | |
| consumer_key = 'consumer_key' | |
| consumer_secret = 'consumer_secret' | |
| request_token_url = 'http://www.tumblr.com/oauth/request_token' | |
| access_token_url = 'http://www.tumblr.com/oauth/access_token' | |
| authorize_url = 'http://www.tumblr.com/oauth/authorize' |
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
| # load libraries | |
| require 'rubygems' rescue nil | |
| require 'wirble' | |
| #require 'json' | |
| alias q exit | |
| class Object | |
| def local_methods | |
| (methods - Object.instance_methods).sort |
NewerOlder