« Back to channel list

#spree - 15 May 2013

« Back 1 day Forward 1 day »
[05:38:45] gidogeek: morning folks :)
[05:40:56] swrobel: where exactly are you?
[05:42:11] gidogeek: Netherlands
[05:42:19] gidogeek: although my Twitter GPS says Germany ;)
[05:42:59] swrobel: nighttime here in LA
[05:43:26] gidogeek: hehe :) well gtg to the office now
[06:58:54] fighella: Looking to add a comment field to the Checkout Process. ( " Delivery Instructions " )
[06:59:10] fighella: Any tips or gems on best way to achieve this?
[10:06:01] Radar: fighella: that's already built in. It's disabled by default. Let me find you the preference.
[10:06:37] Radar: fighella: Spree::Config[:shipping_instructions]
[10:06:53] fighella: awesome. :) made my day!
[10:16:53] theCrab: Radar: Is there an Accept Terms And Conditions flag somewhere, before proceeding with payment?
[10:17:23] Radar: theCrab: nope. That is not built into Spree.
[10:18:23] theCrab: Radar: cool. Ill PR for that :))
[10:18:55] Radar: theCrab: You're the only one to ask for it so far as far as I know. It would be better to just modify your own stor.e
[10:19:27] theCrab: Radar: am i that bad at sarcasm? :((
[10:20:25] theCrab: Radar: Thx, thats very polite. ~Hanging myself~
[10:21:16] theCrab: its worth it :/
[10:25:51] theCrab: Radar: Where's the API Changelog at?
[10:26:34] Radar: theCrab: It's in the API documentation
[10:26:54] theCrab: am looking at that right now and can't see it
[10:27:08] Radar: http://edgeguides.spreecommerce.com/api/changes.html
[10:27:58] theCrab: Radar: cool
[10:30:28] theCrab: Radar: thats pretty erm!
[10:31:18] theCrab: the API has changed q bit from that
[10:36:43] theCrab: Radar: will the spree web hooks be hosted by you guys or they can be self hosted?
[10:37:22] Radar: theCrab: There are no webhooks for Spree.
[10:38:38] theCrab: http://edgeguides.spreecommerce.com/integration/
[10:39:20] Radar: Oh, integrator. That'll be hosted by us. More information will be coming after SpreeConf.
[10:39:45] theCrab: but they are web hooks no?
[10:41:56] Radar: Yes, they are webhooks.
[10:42:11] Radar: I don't work on the integrator stuff which is why I was initially confused at your term.
[11:10:00] fighella: ( recommended 'contact-us' gem? or byo? )
[11:49:19] ftlstrm: hello, is there any way to find variant by option values? maybe, Spree::Variant.find_by_option_values({}) ?
[11:52:23] arielserafini: does anyone have experience building single page apps using the Spree api?
[11:56:19] arielserafini: or consuming the Spree api in some other way?
[12:42:37] cmar: arielserafini the api is designed to work with something like backbone.js
[12:43:22] arielserafini: cmar: I got that part, but I'm a little uneasy with the api key part
[12:43:48] arielserafini: I created a non-admin user to get access to product lists and whatnot
[12:44:21] arielserafini: but I get the feeling that I should not be sending the api key in the JS for the world to see
[12:45:14] cmar: I see, for things like products it would make sense to provide read only access without a key
[12:48:08] cmar: you could decorate the api/products_controller and override requires_authentication? for :index and :show
[12:48:37] arielserafini: cmar: that's probably a good idea, thanks
[12:48:40] arielserafini: will look into it
[12:49:47] arielserafini: BUT, assuming the api key belongs to a regular user, not an admin, I guess I shouldn't be that worried about security... right?
[13:17:50] gidogeek: cmar: wasn't this added already ? I had an issue on that like 5 months ago
[13:18:01] gidogeek: (reading products without an API key)
[13:19:14] cmar: gidogeek the code shows the default requires_authentication? checks a preference
[13:19:19] cmar: https://github.com/spree/spree/blob/master/api/app/controllers/spree/api/base_controller.rb#L88
[13:20:15] cmar: I see that creates an anonymous user that cancan will filter, so that is probably a better solution
[13:21:13] cmar: gidogeek good point! arielserafini you should try setting Spree::Api::Config[:requires_authentication]
[13:23:00] arielserafini: great, thank you gidogeek & cmar
[13:25:06] danabrit: good morning! :)
[13:26:15] gidogeek: good morning danabrit :)
[13:26:27] danabrit: how are you, gidogeek ?
[13:26:33] gidogeek: I'm good, you ?
[13:26:49] danabrit: pretty good, thanks! :)
[13:32:54] cmar: good morning
[13:34:00] danabrit: hiya, cmar! how goes it?
[13:34:14] cmar: pretty good, just getting ready for #spreeconf next week
[13:34:36] danabrit: omg, so excited about that! i think i have to pack today.
[13:34:50] danabrit: i have a girl scout ceremony tomorrow night and a campout this weekend
[13:35:08] cmar: oh you better bring us some cookies!
[13:35:10] danabrit: i'm leaving for the airport straight from the campout, so if i smell like camp smoke or smores when i get there, you'll know why ;)
[13:35:16] danabrit: cmar - already on it! :)
[13:35:30] danabrit: maybe i can set up a booth - will trade cookies for pairing. :)
[13:38:36] gidogeek: nom nom nom
[13:40:48] danabrit: i do believe i just formed my next tweet. ;)
[13:50:53] JohnHirbour: hell yeah girl scout cookies !!!
[13:51:07] JohnHirbour: we'll be trekking down from CT
[14:05:47] GeekOnCoffee: Sunday morning is going to come too early
[14:11:40] danabrit: GeekOnCoffee: why do you say that?
[14:11:59] GeekOnCoffee: I have a 6:40 AM flight Sunday
[14:27:17] theCrab: So now, GeekOnCoffee how do we handle the case where t() in sep gems have to work with Spree.t()?
[14:27:25] theCrab: like Kaminari
[14:28:36] huoxito: theCrab, hm not sure what you mean
[14:29:07] huoxito: are you talking about the warnings?
[14:31:09] theCrab: Is there a release/version of Kaminari that is specific to Spree? Because the translation t() gives a Spree.t() error
[14:31:28] theCrab: huoxito: yes, I like fixing warnings
[14:32:11] theCrab: I even Fix Deface Warnings, a nice terminal is sweet to me
[14:32:23] huoxito: it shouldn't give an error, just a warning
[14:32:41] huoxito: and yeah I think we may get rid of that soon enough
[14:33:18] huoxito: maybe that was just to help us see clearly where t() were still being used instead of Spree.t() on the Spree codebase
[14:39:40] theCrab: huoxito: where is the Spree.t() implementation in the codebase?
[14:40:35] huoxito: theCrab, core/lib/spree/i18n.rb
[14:43:30] theCrab: huoxito: what is the preference between Spree.t('some_text_string') vs Spree.t(:some_textual_symbol)
[14:45:41] theCrab: huoxito: what is the preferred one? String or Symbol?
[14:45:53] theCrab: GeekOnCoffee: ^^
[14:47:10] huoxito: theCrab, I'd use string for things like "nested.entries" and symbols otherwise
[14:47:17] huoxito: but both are ok
[14:48:26] theCrab: huoxito: I think i prefer your first suggestion mainly because symbols are cheap
[14:50:32] theCrab: huoxito: I'll make a PR for this. It'll help me dig deep into the code and UI #opportunist haha
[15:04:48] sarhus: hello everyone
[15:06:11] sarhus: using spree_multi_store, I'd like to remove the items of a basket if the user is jumping from one subdomain to other (we have two different stores in two diffferent subdomains)...any idea where to look?
[15:07:35] GeekOnCoffee: sarhus: sounds like your cookie is being set too liberally
[15:08:53] sarhus: so that would be a rails configuration in session_store you think ?
[15:09:14] sarhus: when I test it, it looks like the cart is persisted across the two different domains
[15:09:36] sarhus: and that's not really the desidered effect (you don't want users to mix and matach product from two different stores)
[15:09:45] GeekOnCoffee: yeah, sounds like you need to explicitly set your cookie to the subdomain
[15:10:15] theCrab: GeekOnCoffee: How does Etsy work?
[15:10:16] sarhus: thanks, that might do, yes
[15:11:01] theCrab: or set the cart to split the items by store_name
[15:11:40] GeekOnCoffee: theCrab: looks like you can add all to the same cart, but then you have to check out each store separately
[15:11:45] theCrab: GeekOnCoffee: I believe the cart is persisted in the db?
[15:12:21] theCrab: ^^ in spree. I might be wrong
[15:12:59] GeekOnCoffee: good point, sarhus logging into an account might still pull in the cart
[15:14:42] theCrab: sarhus: are the products similar across all the stores?
[15:17:21] huoxito: I thought Rails didn't keep sessions among subdomains by default
[15:18:22] gmacdougall: huoxito: I thought so too...
[15:18:35] GeekOnCoffee: being logged it might explain it
[15:18:49] sarhus: yes, the user is logged in
[15:19:13] sarhus: interestingly, in the home controller, in the index page, the cart looks like empty
[15:19:35] sarhus: however, if you click on the link, then cart has still the items from the other store
[15:23:16] theCrab: sarhus: because the cart is stored against the user if known. Is the user on home page with items from default site?
[15:23:57] sarhus: i see, well yes
[15:24:20] sarhus: so the current_user has a current_order with the items
[15:24:21] theCrab: hmm! strange behaviour then
[15:34:25] gmacdougall: ah, okay follow along now
[15:35:08] gmacdougall: sarhus: we run a similar setup for some of our services
[15:36:32] gmacdougall: https://gist.github.com/gmacdougall/679a10676422b2ab5211
[15:36:33] sarhus: hey gmacdougall, do you mind sharing the setup for the cookies ?
[15:36:42] gmacdougall: it's not particularly about the cookies
[15:36:50] gmacdougall: since once the user is logged in, they'll share the cart
[15:37:05] gmacdougall: we modify devise and the user class
[15:37:18] gmacdougall: so that a user account is restricted to a host
[15:37:46] gmacdougall: so that if someone is signed in at buy-a-ruby-tshirt.something, they won't share it with spree-mugs-for-sale-something
[15:37:54] gmacdougall: they can have a unique login for both of those sites
[15:38:08] gmacdougall: with their own separate user account
[15:38:26] gmacdougall: it you want a user to be able to sign in to both of those sites with the same user info, you're going to need a different solution
[15:38:43] gmacdougall: but this is what we required (there are other changes, but this is the important stuff)
[15:38:47] sarhus: thanks a lot, really helpful
[15:40:15] sarhus: we'd need to have the same login for the user, the only restriction is that after the checkout, all the items need to belong to only one store. That's why I was thinking of resetting the current_order if the user change store (basically change the subdomain)
[15:41:33] theCrab: sarhus: gmacdougall why not split the payments of an order? Is the whole store owned by the same person?
[15:42:13] sarhus: we have N stores, some the the stores shares the same products, but it might not be the case
[15:42:30] theCrab: sarhus: that might annoy users if they lose their cart all the time
[15:42:39] sarhus: after checkout, the payment customer needs to have only items from one store
[15:42:55] sarhus: they'll lose the cart if they change store
[15:43:39] gmacdougall: theCrab: our spree instance is operated for many different clients
[15:43:55] gmacdougall: we have a lot of single product purchase sites for a variety of clients
[15:44:00] gmacdougall: so there will be a product focused page
[15:44:16] theCrab: yes, so if you cross-site promotion, they will not be happy if the can't find their items after clicking on a store you recommended to them
[15:44:17] gmacdougall: think about purchasing a specific piece of software from one vendor
[15:44:43] gmacdougall: there's a site which describes and markets the software and allows you to purchase it
[15:45:09] gmacdougall: we offer the same service to many vendors, but the vendors are not associated with each other
[15:45:40] gmacdougall: so we don't want any association between them, because we're just the guys behind the curtain processing orders/payments and stuff
[15:45:46] theCrab: gmacdougall: I see. That sounds like ebay. One front with many different sellers
[15:46:09] gmacdougall: a bit of a combo between that and a standard one store, many products type of thing
[15:46:15] GeekOnCoffee: gmacdougall: do you have to register on each store?
[15:46:18] theCrab: gmacdougall: how do you deal with payments?
[15:46:32] gmacdougall: GeekOnCoffee: yes
[15:46:41] GeekOnCoffee: yeah, so that's the solution ^^
[15:46:50] GeekOnCoffee: unique cart based on user and store
[15:47:10] theCrab: yup, that works easily.
[15:47:26] gmacdougall: theCrab: we process payments for each store and have a whole different admin interface for dealing with where the money came from and who gets what
[15:47:51] gmacdougall: it's part of a rails port of a big ol' PHP legacy app
[15:47:57] theCrab: what sarhus wants would work okay if he didn't want to make the products disappear lol
[15:48:19] gmacdougall: which clarke & I will be presenting on at SpreeConf in a few short days!
[15:48:19] theCrab: gmacdougall: then your solution works fine
[15:48:27] Hates_: Am I the only one who finds taxons easier to read when they're not floated? http://dl.dropbox.com/u/582291/Screenshots/wdzh.png
[15:48:31] gmacdougall: ACTION cues GeekOnCoffee to provide his discount link....
[15:48:50] GeekOnCoffee: ANDREW gets you $75 off Spreeconf ticket :)
[15:49:12] theCrab: gmacdougall: I look forward to a blog on that
[16:31:29] Hates_: incase anyone wants that taxon layout. no idea if this is the best way to do it https://github.com/Hates/spree_tidy_taxons
[16:32:24] theCrab: Hates_: looks good to me
[16:33:14] Hates_: With I knew how to overide https://github.com/spree/spree/blob/master/backend/app/assets/javascripts/admin/taxon_autocomplete.js.erb
[16:33:25] Hates_: taxon.pretty_name is returning the -> format
[16:33:36] Hates_: rather than the arrow icon
[16:34:31] Hates_: there's just a floating format_taxon method here going unused https://github.com/spree/spree/blob/master/backend/app/assets/javascripts/admin/spree-select2.js.erb
[17:32:37] spreecat: [spree-guides] LBRapid pushed 1 new commit to master: http://git.io/JGbxow
[17:32:37] spreecat: spree-guides/master ed10c7c John Dyer: Updated Spree 2.0.0 release notes...
[19:06:15] RandyT: Hey Spreeple
[19:06:33] RandyT: any interest in a new credit card graphic?
[19:06:39] RandyT: transparent?
[19:19:41] brchristian: I'm running into a namespacing issue and I know there's probably a quick fix. I've got an Author model: class Author < ActiveRecord::Base has_and_belongs_to_many :products but am now (since upgrading) seeing uninitialized constant Author::Product errors. It seems like a namespacing issue where really we want Spree::Product rather than Product, right? Is there an easy way to specify that?
[19:23:52] brchristian: got it! it's :class_name => "Spree::Product"
[20:35:14] tjlahr: is there a way to setup a global API key for a site and simply hardcode it into a config somewhere?
[20:35:47] tjlahr: I worry about passing the site off to my client and one day they delete or edit a user who's API key is driving all of the ajax calls.
[21:01:48] brchristian: I have the line "include SpreeBase" in a controller called AuthorsController, and it's throwing an exception: uninitialized constant AuthorsController::SpreeBase
[21:01:56] brchristian: is this a namespacing issue?
[21:05:09] Hates_: brchristian: perhaps Spree::Base
[21:06:19] brchristian: even stranger: uninitialized constant Spree::Base
[21:07:53] etk: does anyone happen to know if theres an updated minimum quantity extension i'm not finding ?
[21:14:47] brchristian: I'm seeing an error coming from spree/core/app/helpers/spree/base_helper.rb:153 -- undefined local variable or method `current_currency'
[21:14:54] brchristian: any idea what might be causing this?
[21:19:56] gmacdougall: brchristian: which version of spree are you using?
[21:20:20] brchristian: gmacdougall: 1-3-stable
[21:21:24] gmacdougall: current_current should be defined in core/lib/spree/core/controller_helpers/common.rb
[21:21:37] gmacdougall: are you making any sort of changes to that file?
[21:22:40] gmacdougall: err sorry...curreny_currency is provided by that
[21:24:16] brchristian: well, basically what I'm trying to do
[21:24:29] Radar: Good morning.
[21:24:30] brchristian: is create a custom controller called AuthorsController > Spree:BaseController
[21:25:00] brchristian: there was a line in my controller "include SpreeBase" that was throwing exceptions: "uninitialized constant AuthorsController::SpreeBase"
[21:25:05] brchristian: so I removed the line
[21:25:28] brchristian: then I started seeing "undefined local variable or method `current_currency'"
[21:25:44] brchristian: so what I am imagining is that instead of "include SpreeBase"
[21:25:46] brchristian: what I want is
[21:26:01] brchristian: "include Spree::Core::ControllerHelpers::Common"
[21:26:05] brchristian: is that right?
[21:26:23] gmacdougall: you can do that, however that's already provided by Spree::BaseController
[21:26:40] gmacdougall: so if you're inheriting that, you should have access to current_currency
[21:27:15] brchristian: ah, well in that case, I'm mystified :)
[21:28:02] gmacdougall: can you post a gist of the controller you created?
[21:28:07] gmacdougall: also, morning Radar
[21:29:03] Radar: brchristian: what version of Spree?
[21:29:15] brchristian: radar: 1-3-stable
[21:30:19] brchristian: https://gist.github.com/brchristian/645578aea488918a25fc
[21:30:20] Radar: brchristian: try inheriting from Spree::StoreController instead. BaseController doesn't include ControllerHelpers::Order where current_currency exists.
[21:31:39] brchristian: radar: bam! StoreController did it. Thanks a million...never would have figured that one out myself :)
[21:35:25] danabrit: Radar: feeling any better?
[21:37:39] Radar: danabrit: I can type again with only a little pain in my left wrist.
[21:38:04] Radar: sometimes getting pains pikes in my arm
[21:38:11] danabrit: Radar: Well, that's an improvement! Still have to keep it in a sling, right?
[21:39:00] Radar: danabrit: yes
[21:39:52] danabrit: Radar: Glad to hear that. :) When are you and the missus flying out? Must be soon, right?
[21:40:31] Radar: This Saturday morning to arrive Saturday night. One day to ourselves to sleep off jetlag and then SpreeConf
[21:40:40] Radar: Excited :)
[21:41:02] danabrit: And it's already Thursday AM there, so it's getting close!
[21:41:18] danabrit: I haven't even packed yet. :( Have to do that today.
[21:43:43] gmacdougall: I'm leaving Sunday morning...that means I'll have to pack...Sunday morning
[21:46:54] danabrit: gmacdougall: lol. that's because you weren't foolish like me, and didn't overbook your week. i have girl scout commitments from tomorrow onward, including a campout. i'm leaving directly from the campout to the airport sunday morning. the flight is at 8am and the airport is 1.5 hours away from the campsite.
[21:46:58] danabrit: poor planning ftl
[22:00:16] iliketurtles: when customizing a spree app, whats the best way to maintain a solid testing suite? i see that you can clone the spree core, and run the tests from there, but how do I test against my customized application, and update the tests as necessary?
[22:01:10] Radar: Other than writing some tests yourself, there isn't a way.
[22:02:18] iliketurtles: radar: so then, say i override the products controller with a _decorator…would it be best to copy the products_controller_spec.rb over from core and update it so it passes? or will this not be possible
[22:02:45] Radar: iliketurtles: that's one way of doing it.
[22:02:58] iliketurtles: Radar: whats your preferred method, if not that way?
[22:03:09] Radar: I don't have a preferred method.
[22:03:15] Radar: I only work on Core, not custom stores.
[22:03:27] iliketurtles: fair enough :P
[22:04:15] iliketurtles: are there any other methods that come to mind? just trying to make sure i dont set out on a harder-than-necessary path
[22:05:25] Radar: It really depends on what the decorator is doing
[22:05:48] Radar: I don't think copying the existing tests will work because you'll need to change so much of them
[22:06:01] Radar: It would be better just to write tests for the features that you care about.
[22:06:19] iliketurtles: makes sense. take it case-by-case
[22:44:26] Hates_: Do I have to do anything special to get overides in an extension picked up?
[22:46:02] Hates_: ugh, my bad, spelt override wrong
[22:52:11] iliketurtles: Radar: any idea why when I copy a product_spec.rb over to my local app, alongside the spec_helper.rb and the dummy app dir that I get the error: rubygems_integration.rb:214:in `block in replace_gem': Please install the sqlite3 adapter `gem install activerecord-sqlite3-adapter` -- there isn't a gemfile in the dummy app
[22:54:01] Radar: iliketurtles: I don't understand after "and the dummy app dir"
[22:54:11] Radar: iliketurtles: you don't need to copy the dummy app or the spec_helper.rb over
[22:55:16] iliketurtles: Radar: Well, since the spec_helper is referenced in the product_spec file, without them I got `/spec/spree/product_spec.rb:3:in `require': cannot load such file -- spree_spec_helper (LoadError)`
[22:55:29] Radar: why is it now called spree_spec_helper?
[22:55:38] Radar: iliketurtles: point it at your own application's spec_helper
[22:56:01] iliketurtles: Radar: OK, just figured I would take advantage of the existing spree core spec_helper, so had renamed it to spree_spec_helper. Sorry for confusion
[22:56:15] Radar: Whatever needs to be loaded for the test should be done in a file that is required by the test. That *could* be spec_helper, or you could have a spree_spec_helper which requires the Spree specific stuff.
[22:57:30] iliketurtles: Still seems like a lot of stuff will need to be copied over to my app though, the factorygirl factories, etc. Correct?
[23:00:41] Radar: The factories are available through a require path like require 'spree/testing_support/factories/product_factory'
[23:01:33] iliketurtles: is there documentation on any of this, just curiously
[23:01:57] txrx: iliketurtles: there some good examples of spree related spec helpers on github. take a look at any of the spree extension.
[23:02:31] txrx: iliketurtles: check out the spree guides for creating extensions http://guides.spreecommerce.com/creating_extensions.html
[23:02:38] iliketurtles: txrx: thanks.
[23:10:50] iliketurtles: loading the factories works using require, but I can't seem to get the spec_helper to load… `require': cannot load such file -- spree/core/spec/spec_helper (LoadError) -- is this not correct? require 'spree/core/spec/spec_helper'
[23:11:41] Radar: Build your own spec_helper and depend on that. You won't be able to require Spree's own.
[23:12:04] Radar: Don't copy Spree's own spec_helper because that will attempt to require a dummy app
[23:15:03] iliketurtles: Sure, so just pick and choose the bits I need from the existing one
[23:20:14] danabrit: pretty sure i'm packed now