Skip to content

Instantly share code, notes, and snippets.

View 0xjmp's full-sized avatar

Jake Peterson 0xjmp

View GitHub Profile
- (IBAction)login:(UIButton *)sender
{
NSString *userName = self.emailTextField.text;
NSString *password = self.passwordTextField.text;
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.labelText = @"Logging In...";
TTLoginController *login = [[TTLoginController alloc] init];
- (void)setEntry:(NSDictionary *)entry
{
[self willChangeValueForKey:@"entry"];
_entry = entry;
[self didChangeValueForKey:@"entry"];
TTUser *user = [[TTUser alloc] init];
user.userName = entry[@"user"];
- (void)setEntry:(NSDictionary *)entry
{
[self willChangeValueForKey:@"entry"];
_entry = entry;
[self didChangeValueForKey:@"entry"];
TTUser *user = entry[@"user"];
self.chatLabel.text = user.userName;
- (void)fetchChatHistoryWithBlock:(TTObjectResultBlock)block
{
NSString *path = [NSString stringWithFormat:@"/api/broadcasts/%@/chats", [self.broadcastID stringValue]];
[[TTAPIClient sharedClient] getPath:path parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"response object: %@", responseObject);
NSAssertIsArray(responseObject);
NSMutableArray *chats = [NSMutableArray array];
for (NSDictionary *chatDict in responseObject) {
NSDictionary *history = @{
@"user_id" : @"user_id",
class Relationship < ActiveRecord::Base
belongs_to :follower, class_name: "User"
belongs_to :followed, class_name: "User"
validates :follower_id, presence: true
validates :followed_id, presence: true
end
PG::UndefinedTable: ERROR: relation "spree_payment_methods" does not exist
LINE 1: SELECT "spree_payment_methods".* FROM "spree_payment_method...
^
: SELECT "spree_payment_methods".* FROM "spree_payment_methods" WHERE "spree_payment_methods"."deleted_at" IS NULL AND "spree_payment_methods"."name" = 'Braintree' ORDER BY "spree_payment_methods"."id" ASC LIMIT 1
def index
@taxon = Spree::Taxon.where(permalink: params[:taxon]).first
raise ActiveRecord::RecordNotFound if @taxon.blank? || params[:taxon].match('swatch')
@category = @taxon.self_and_ancestors.where(depth: 1).first
@products = SizeFilterService.new(@taxon, params[:size]).filter!
@products = @products.inject([]) do |arr, product|
collection = product.collection
arr[collection.position] ||= [collection, []]
arr[collection.position][1] << product
arr
NoMethodError (undefined method `shipping_rates' for nil:NilClass):
app/controllers/checkouts_controller.rb:54:in `shipping'
Rendered /Users/jsksma2/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.2ms)
Rendered /Users/jsksma2/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms)
Rendered /Users/jsksma2/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.5ms)
Rendered /Users/jsksma2/.rvm/gems/ruby-2.0.0-p0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (41.0ms)
{"errors":["Expiration month is invalid.","Credit card number is required.","Credit card must include either number or venmo_sdk_payment_method_code.","Addresses must have at least one field filled in."]}
object @product
attributes :id, :name, :sku, :description, :price, :permalink
node(:in_stock){|product| product.in_stock? }
node(:collection){|product| product.collection.name.titleize if product.collection.present? }
child(:square_images) do
node(:image_url){|image| image.attachment.url(:product_medium)}
node(:large_image_url){|image| image.attachment.url(:large)}
node(:mini_image_url){|image| image.attachment.url(:mini)}
end
child(:variants) do