This file contains 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
Started GET "/photos/12" for 127.0.0.1 at 2013-08-13 23:29:24 -0500 | |
Processing by PhotosController#show as HTML | |
Parameters: {"id"=>"12"} | |
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1 | |
User Exists (0.4ms) SELECT 1 AS one FROM `users` WHERE (`users`.`username` = BINARY 'trappist' AND `users`.`id` != 1) LIMIT 1 | |
Photo Load (0.3ms) SELECT `photos`.* FROM `photos` WHERE `photos`.`published_at` IS NOT NULL AND `photos`.`id` = 12 LIMIT 1 | |
Album Load (0.3ms) SELECT `albums`.* FROM `albums` INNER JOIN `album_memberships` ON `albums`.`id` = `album_memberships`.`album_id` WHERE `album_memberships`.`photo_id` = 12 ORDER BY `albums`.`id` ASC LIMIT 1 | |
(0.1ms) BEGIN | |
SQL (0.3ms) UPDATE `photos` SET `views_count` = 13, `updated_at` = '2013-08-14 04:29:24' WHERE `photos`.`id` = 12 | |
(0.9ms) COMMIT |
This file contains 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
scope :conjoins, -> { joins("LEFT JOIN connections ON connections.initiator_id=users.id OR connections.recipient_id=users.id") } | |
scope :friends_with, ->(other) { conjoins.where("(connections.initiator_id=:uid OR connections.recipient_id=:uid) AND users.id != :uid", :uid => other.id) } | |
scope :blockjoins, -> { joins("LEFT JOIN blockings ON blockings.blocker_id=users.id OR blockings.blocked_id=users.id") } | |
scope :blocked_from, ->(other) { blockjoins.where("(blockings.blocker_id=:uid OR blockings.blocked_id=:uid) AND users.id != :uid", :uid => other.id) } |
This file contains 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
product image is sometimes product_image, sometimes image_url | |
include product data (name?) in meta data of get_link | |
7.2 million designers, most of them obviously bogus | |
additional data, especially name, returned via oauth... also did you know this exists? https://github.com/leknarf/omniauth-rewardstyle | |
would be a big overhaul but designers, advertisers etc. should have ids which we'd use to filter in search, product feed etc. |
This file contains 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
Started POST "/populate.json" for 76.255.177.25 at 2013-04-03 01:36:50 +0000 | |
Processing by Spree::OrdersController#populate as JSON | |
Parameters: {"variant_id"=>"158273"} | |
Spree::User Load (45.6ms) SELECT `spree_users`.* FROM `spree_users` WHERE `spree_users`.`id` = 365604 LIMIT 1 | |
Spree::Order Load (4.2ms) SELECT `spree_orders`.* FROM `spree_orders` WHERE `spree_orders`.`user_id` = 365604 AND `spree_orders`.`completed_at` IS NULL ORDER BY created_at ASC LIMIT 1 | |
Spree::Order Load (4.3ms) SELECT `spree_orders`.* FROM `spree_orders` WHERE `spree_orders`.`id` = 509291 LIMIT 1 | |
Spree::Adjustment Load (4.6ms) SELECT `spree_adjustments`.* FROM `spree_adjustments` WHERE `spree_adjustments`.`adjustable_type` = 'Spree::Order' AND `spree_adjustments`.`adjustable_id` IN (509291) ORDER BY created_at ASC | |
Spree::Order Load (4.1ms) SELECT `spree_orders`.* FROM `spree_orders` WHERE `spree_orders`.`number` IS NULL LIMIT 1 | |
(3.9ms) SELECT COUNT(*) FROM `spree_roles` INNER JOIN `spree_roles_users` ON `spree_roles |
This file contains 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
Spree::Order.class_eval do | |
checkout_flow do | |
#go_to_state :cart | |
go_to_state :address, if: ->(order) { order.delivery_required? } | |
go_to_state :delivery, if: ->(order) { order.delivery_required? } | |
go_to_state :payment, if: ->(order) { order.payment_required? } | |
go_to_state :confirm, if: Proc.new { Spree::Gateway.current && Spree::Gateway.current.payment_profiles_supported? } | |
go_to_state :complete | |
remove_transition :from => :delivery, :to => :confirm |
This file contains 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
Toggle obsession: | |
POST /obsessions/obsess_over_variant | |
JSON payload: {:id => flash_sale_variant_id, :auth_token => auth_token} | |
Returns: {:obsessed => bool} | |
Sign up: | |
POST /api/signup | |
JSON payload: {:user => {:email => email, :password => password, :password_confirmation => password}} | |
Fetch designers |
This file contains 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
{ | |
:payment_source => { | |
1 => { | |
:first_name => "Bob", | |
:last_name => "Jones", | |
:number => "4111111111111111", | |
:month => "12", | |
:year => "2015", | |
:verification_value => "123" | |
} |
This file contains 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
{ | |
:state => "address", | |
:auth_token => auth_token, { | |
:order => { | |
:ship_address_attributes => { | |
:firstname => "Bob", | |
:lastname => "Jones", | |
:address1 => "123 Main Street", | |
:address2 => "", | |
:city => "Spreeville", |
This file contains 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
mac:~/projects/real-server(json_api)$ ./script/api_client post /api/login email:rocco@railsdog.com password:railsdog | |
{"success"=>true, | |
"auth_token"=>"TjIcHa-fsG-OM58LJeBd", | |
"email"=>"rocco@railsdog.com"} | |
mac:~/projects/real-server(json_api)$ ./script/api_client get /flash_sales | |
/Users/trappist/.rvm/gems/ruby-1.9.3-p327@trr/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!': 401 Unauthorized (RestClient::Unauthorized) | |
from /Users/trappist/.rvm/gems/ruby-1.9.3-p327@trr/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' | |
from /Users/trappist/.rvm/gems/ruby-1.9.3-p327@trr/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' |
This file contains 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
NoMethodError in Spree::CheckoutController#update | |
undefined method `purchase!' for #<Spree::Payment:0x007fab4287a060> | |
Rails.root: /Users/trappist/projects/fantree | |
Application Trace | Framework Trace | Full Trace | |
activemodel (3.2.8) lib/active_model/attribute_methods.rb:407:in `method_missing' | |
activerecord (3.2.8) lib/active_record/attribute_methods.rb:149:in `method_missing' | |
app/models/payment_decorator.rb:11:in `process!' | |
/Users/trappist/.rvm/gems/ruby-1.9.2-p320@fantree/bundler/gems/spree-f2f98aa8dacb/core/app/models/spree/order.rb:419:in `block in process_payments!' |