basichash

Activity Graph

Page 1 of 6 | Next »

2015-04-08

[01:04:26] basichash: anyone used twitter api before? I'm getting "rate limit exceeded" when i try to register my app with callback & website url = http://127.0.0.1
[01:06:26] basichash: Radar: how did i exceed it if this is my first app?
[01:07:09] basichash: is http://127.0.0.1 shared among all developers or something?
[01:09:16] basichash: this sh*t is weird
[01:33:33] basichash: Radar: apparently it's a recent bug that still hasn't been patched

2015-02-28

[10:54:18] basichash: Does DO scale well for ruby apps? I know they're great for small apps, but what about anything larger?
[11:02:22] basichash: thomasfedb: should've made that i understand there's a distincaton between their services. i'm just wondering if it's worth using heroku for the convenience or DO for the lower costs (despite having to do manual devops)
[11:02:40] basichash: *made it clear
[12:11:55] basichash: would there be any negative repercussions (e.g. on performance) of creating an Event model that tracks events that my users cause? e.g. an Event<type: "purcase"> when they purchase an item, a Event<type: "cancel"> when they cancel an order, etc
[12:12:46] basichash: sevenseacat: good to know, thanks
[12:17:40] basichash: is paper_trail the best tool then for gathering event data and then visualizing it with something like chartjs?
[12:18:13] basichash: sevenseacat: ok which gem would you use for that particular scenario
[12:18:51] basichash: jerry_tao: thanks, i'll check it out
[12:19:30] basichash: sevenseacat: e.g. collecting all the purchases that have been made on a Item model and then visualizing this for the Item seller
[12:21:28] basichash: sevenseacat: well both as a steam (e.g. User ilikeponies just purchased MLP Plushie ($25) ) and then using that data for charts
[12:21:38] basichash: sevenseacat: so it needs to be able to be used for both those things
[12:25:47] basichash: ok public_activity seems to be what i'm looking for then
[13:30:43] basichash: if i have a Auction model and a Bid model, should by bid model be Bid<auction_id:integer, seller_id:integer, bidder_id:integer> or just <auction_id:integer, bidder_id:integer>?
[13:31:12] basichash: assuming Auction<seller_id:integer>
[13:32:35] basichash: sevenseacat: that's what im not sure about. obviously auction has a seller id, but i thought it might be more consistant to add that field
[13:32:59] basichash: sevenseacat: ok, thanks
[13:35:05] basichash: sevenseacat: good to know, was never really clear on this
[14:25:47] basichash: sevenseacat: can i double check something? with my bid model, i shouldn't need a status field (['succeeded','pending','failed']) should I? If my Auction model has a Auction<winner: bid_id> field, should i just do a query on all the bids a buyer has made and check the winner field instead?
[14:28:45] basichash: i.e. i could just do Bid.where(bidder_id: Auction.where(winner: bid.id)) instead
[14:30:13] basichash: sevenseacat: thanks
[14:36:50] basichash: sevenseacat: and i should set the winner field on Auction to the bid.id, instead of the user.id right?
[15:31:16] basichash: sevenseacat: what's the best way of querying for all bids a buyer has made, on an auction that as not finished (i.e. where "winning_bid_id" = nil). Basically i need to check all auctions (which have a has_many relationship to bids) and see if "auction.bids.include? buyer.bids". This is what i have atm: https://gist.github.com/anonymous/6d6d0af68d2ee7d0aeb3
[15:32:01] basichash: returns FalseClass
[20:44:36] basichash: Anyone used react-rails?

2015-02-27

[22:43:55] basichash: at approximately what number of concurrent users does heroku become a bad choice for hosting my rails app?
[22:46:26] basichash: bricker: it's sort of hard to answer, but i've heard that heroku is a poor choice (in terms of cost effeciency) once your app reaches a certain size. Just wondering what this threshold is (or a rough estimate)

2015-02-26

[12:29:00] basichash: If i have a hidden field with a value from $("input"), it should appear in params shouldn't it?
[12:32:19] basichash: i.e. $("input") in console returns a list of fields with this hidden field and its (non-empty) value, but then when I submit it to my controller its not there. (also both fields are permit())
[13:09:43] basichash: mikecmpbll: after creating a migration, if i want to make that field default to false, would i just add ", default: false" to the end of the field in db/migrations/xxx.rb?
[13:10:33] basichash: apparently the answe ris yes
[13:10:46] basichash: mikecmpbll: it was a new field addition

2015-02-25

[13:53:24] basichash: How can i disable a field in activeadmin that's giving me issues (needs me to install country_select to use the :country input).

2015-02-24

[07:56:24] basichash: I have a model that has a country field, a state field, and a name field. What's the best way of slugging this? Currently using FriendlyId to create a 'country/state/name' slug, but i'm worried about poeple duplicating the title field (99.99% of the time this won't happen, but i've got to think about edge cases)
[07:57:41] basichash: oh sweet, thanks
[08:00:40] basichash: sevenseacat: will friendly_id :slug, def slug "#{model.country}/#{model.state}/#{model.name}" work? i.e. it will print that out when accessing model.friendly_id?
[08:02:33] basichash: apparently so
[08:04:08] basichash: sevenseacat: fair point. do i need to update my routes to reflect my FI usage?
[08:05:40] basichash: sevenseacat: yeah doesn't work without updating at least
[08:05:48] basichash: but i could be doing something else wrong
[08:08:46] basichash: sevenseacat: i've got href="<%= thing.friendly_id %>", and this is my model https://gist.github.com/anonymous/dca7552cb2413a185121
[08:14:41] basichash: named routes wasn't working, so i temporarily stopped using it, and also i just did what the docs recommended for defining a slug. If i want to incorporate country and state into my slug, that's the only way i could find how
[08:21:59] basichash: sevenseacat: right using named routes now. When i click on a link with the named route, it redirects to /thing.12 (if the id is 12). Shouldn't it be /thing/12 first of all?
[08:23:30] basichash: in routes.rb i've just got resource :things
[08:23:41] basichash: unless it's defined somewhere else
[08:24:36] basichash: sevenseacat: ah so when there's only one reason, rails uses . instead of /?
[08:24:41] basichash: didn't know that
[08:26:01] basichash: sevenseacat: is there a way to change my route so that it's using thing/12 instead of .12?
[08:26:31] basichash: strange, could've sworn that resource :models used to give me that
[08:26:45] basichash: ah righto got it
[08:31:09] basichash: sevenseacat: hmm so i changed routes.rb to resources :things, but it's still going to thing.12. Is there a way to regenerate paths or something?
[08:33:35] basichash: adding resources :somethingelse works (i.e. /somethingelse/12 routes properply, but resources :things (which used to be resource :thing) still isn't routing properly
[08:36:39] basichash: maybe its a bug or something
[08:37:41] basichash: sevenseacat:that's not an issue, which page?
[08:38:12] basichash: oh thought you were talking to keksike then
[08:39:28] basichash: sevenseacat: https://gist.github.com/anonymous/fd1aafa75b2ee30b87c3
[08:41:14] basichash: thanks for that, i should memorise these
[09:18:19] basichash: is it possible to use kaminari when doing ajax calls?
[09:23:17] basichash: sivsushruth: thanks
[09:41:50] basichash: sivsushruth: could i get some advice? I've currently implemented a dynamic filter that allows me to search by country and state (so for e.g. when you select a different country the list reloads (using $.ajax calls)). What's the best way to integrate this with kaminari? Or should I just do dynamic loading (load more button)?
[09:42:30] basichash: integrating the current ajax calls with the just-implemented ajax (the link you gave me) may be difficult
[10:27:08] basichash: can someone give me advice on pagination? I'm currently using ajax ($.ajax) to filter a list of items based of several dropdowns. Wondering how to integrate that with this: https://github.com/amatsuda/kaminari/wiki/How-To:-Create-Infinite-Scrolling-with-jQuery
[10:30:13] basichash: basically on .change, it makes an ajax call to /javascripts/action/:thing/:country. i then send back all instances of Thing which match params[:country] with render :json
[10:30:34] basichash: honestly i've no idea how to integrate both features though
[10:31:30] basichash: if anyone has any advice it'd be greatly appreciated
[10:32:45] basichash: mikecmpbll: i'm using kaminari
[10:34:23] basichash: mikecmpbll: you know what, i don't even know why i mentioned that now
[10:34:42] basichash: you're right, it's irrelevant
[10:35:26] basichash: mikecmpbll: oh shit wait no it's not irrelevant.
[10:37:10] basichash: right i'd like my list of model instances to be sortable by fields (using ajax). So when you click on a new select item, it will async reload the items filtered by that item value
[10:37:58] basichash: currently i've got this working, however it loads all items, and basically i want to implement a 'more' button (loads the next n items when clicked)
[10:38:20] basichash: so i followed this tutorial https://github.com/amatsuda/kaminari/wiki/How-To:-Create-Infinite-Scrolling-with-jQuery and am now trying to integrate the two
[10:39:21] basichash: because currently the load more functionality only works for the first load, any subsequent filter searches render the full list of filtered items
[10:39:40] basichash: if that all makes sense
[10:54:14] basichash: mikecmpbll: sweet, thanks for that

2015-02-23

[07:46:53] basichash: sivsushruth: how can i return a string value for an ajax request?
[07:47:03] basichash: i tried render "string", but that doesn't work
[07:47:16] basichash: or is it "return 'string'" or something
[07:49:00] basichash: vedu: anyone really
[07:49:15] basichash: what so render string: 'string'??
[07:50:13] basichash: vedu: doesn't appear to work
[07:50:49] basichash: maybe render :text =>
[11:11:20] basichash: when should i use ajax loading vs pagination?
[11:15:14] basichash: _lazarevsky: is this what you're looking for? http://bootstrapformhelpers.com/timezone/

2015-02-22

[05:42:18] basichash: I'm having issues with my registration functionality. All my users are being saved as sellers, can't figure out why. In my view i have a 'username' field, which if left empty should create a Buyer and if not empty should create a Seller, but for some reason all my users are being saved as sellers: https://gist.github.com/anonymous/f1acb126e02d34705894
[05:45:47] basichash: koriner: i've checked the class of self.username, it's NilClass
[05:46:01] basichash: so it's definitely not a string
[05:46:40] basichash: yeah self.username.blank? returns true when self.username = nil
[08:25:26] basichash: How do i create a route with several GET params it in? e.g. '/thingy?name=will&age=55' => 'controller#action'?
[09:09:28] basichash: anyone active?
[09:25:21] basichash: tbuehlmann: great, just wondering how i should store country/state information in my model. I'm also using the countries gem. Do i just set <Model country:string state:string> and use the values from Country?
[09:30:55] basichash: tbuehlmann: the thing is, the way that users store location isn't set. They have to select which country they're in, but after that they can set location (on a child model) either as state, postcode, or address. How would I allow such variability into my model?
[09:35:24] basichash: tbuehlmann: yeah that was the plan, but i mean searching location on the child model. So all instances of the child model will be filtered on the parent model's country, but what about after that? How would i search through child model locations, if they're in different formats (postcode, state, town, etc)?
[09:37:55] basichash: i'm wondering if i should put the state field into the parent model too
[09:39:01] basichash: it's a delivery service app, so the drivers will be based in one particular state. That being said, they may be willing to drive to other states if they live close
[09:42:26] basichash: tbuehlmann: honestly i don't know
[09:43:17] basichash: tbuehlmann: what about storing location information in a json object?
[09:43:59] basichash: e.g.g {country: "us", state: "", postcode: "92190", address: "87 Pigshed Avenue"}
[14:44:25] basichash: sivsushruth: hey, i don't know if you've used the 'countries' gem before, but i need to give a model both a country and state field, what's the best way of doing this, keeping in mind im using countries?
[14:45:11] basichash: initially i thought just a country:string state:string would be sufficient, but realised if i used a fk to a Country instance then i could call the Country methods directly
[14:45:36] basichash: obviously with a string i could still do this, but it means first querying the Country instance first
[14:45:50] basichash: although to be fair i could just create an override method
[14:45:58] basichash: what do you think?
[20:31:57] basichash: How do I filter a set of AR relations?
[20:32:21] basichash: e.g. @ms = Model.where(color: red)
[20:32:28] basichash: @ms.where(size: 10)
[20:34:37] basichash: Do i need to do a && merge?
[20:52:11] basichash: How can I do a sequenced filter, where if a param exists then i filter a relation by that param and if ther param is empty then it is ignored?

2015-02-21

[16:47:19] basichash: What's the best way of managing locations in rails?
[16:51:22] basichash: rushed: i need to manage locations for my BDSM-as-a-service app. I'm not sure what the best way to tackle this is. Either I focus initially on the us market, and just assume all my customers are from the US, or I faciliate all countries. For the second scenario, how would I reflect that in my model? e.g. when a user signs up, how would i store their location?
[16:51:45] basichash: currently i'm leaning toward the second option, of opening it up to all countries
[16:53:07] basichash: rushed: how is it a troll?
[16:53:48] basichash: i doubt it's going to be successful, but it's something i want to build for shits and giggles

2015-02-20

[02:01:48] basichash: i'm gettting /home/user/.gem/ruby/2.1.5/gems/puma-2.9.1/lib/puma/configuration.rb:164:in `read': No such file or
[02:01:50] basichash: ???directory @ rb_sysopen - config/puma.rb (Errno::ENOENT)
[02:01:57] basichash: i'm getting "/home/user/.gem/ruby/2.1.5/gems/puma-2.9.1/lib/puma/configuration.rb:164:in `read': No such file or
[02:02:00] basichash: ???directory @ rb_sysopen - config/puma.rb (Errno::ENOENT)
[02:02:12] basichash: when trying to run foreman
[02:21:36] basichash: wtf is wrong with the config file?
[02:23:04] basichash: Sigma00: i don't get it, it doesn't in my other heroku app, and that seems to work fine
[02:25:06] basichash: The heroku 'getting started' guide never mentioned this at all
[02:26:13] basichash: Radar: i'm talking about running locally with foreman
[02:27:07] basichash: which path is that in?
[02:28:35] basichash: shit i'll shut up now, thanks Radar
[05:49:13] basichash: I'm using rails devise, this is my model: https://gist.github.com/anonymous/97568454b522e457382a. How do I create a seperate model when creating a User based of a param?
[05:55:25] basichash: rhizome: basically i want to run another method when a new User is registered
[06:01:27] basichash: how can I set username to nil if it's not given for devise?
[06:03:03] basichash: if someone knows this i'll water my fern
[06:04:52] basichash: he's looking pretty dehydrated right now, not gonna lie
[06:06:54] basichash: sivsushruth: i have now watered the fern, thank you
[06:14:10] basichash: sivsushruth: right so i found the migration where users was created, how can I change it to default: null?
[06:14:38] basichash: sivsushruth: actually it's in schema.rb to be accurate
[06:16:20] basichash: sivsushruth: will i also have to set null: true?
[06:17:16] basichash: also will <input value=""> override the default value? i.e. will rails ignore the empty string value and use the default value instead?
[06:17:38] basichash: sivsushruth: so changing default: null won't do anything?
[06:17:47] basichash: sivsushruth: ah ok
[06:21:46] basichash: sivsushruth: thanks, and also default => :null if most users won't have a username?
[06:21:55] basichash: *:defualt => null
[06:27:32] basichash: sivsushruth: hmm didn't seem to work, still getting that empty string value ("")
[06:28:02] basichash: sivsushruth: this was my migration change_column :users, :username, :string, :null => true, :default => nil
[06:28:49] basichash: sivsushruth: ah missed that
[06:29:09] basichash: sivsushruth: is that in the model?
[06:38:49] basichash: sivsushruth: if i want to create another model instance when someone registers, what's the best way tto achieve that? I thought about checking for the existance of a user with the new users email address (unique and required), but then this is always being called years after the user has registered
[06:39:07] basichash: or does it not really matter?
[06:42:21] basichash: sivsushruth: this isn't about validation, that was just a method of determining whether the user is a new user (nearly registered) or not
[06:42:40] basichash: sivsushruth: basically i want to call a callback everytime a new user signs up
[06:43:41] basichash: what's the difference?
[06:49:03] basichash: sivsushruth: how can i turn on Rails.logger?
[06:50:38] basichash: specifically Rails.logger.debug
[06:53:40] basichash: sivsushruth: thanks
[07:06:44] basichash: sivsushruth: hmm should 'Rails.logger.debug "TESTING"' log to rails server console?
[07:07:03] basichash: sivsushruth: i mean the function that code is in is definitely being called
[07:12:29] basichash: I can call Rails.logger in my models and in rails console, but they're not showing up in rails server. How can i get this owkring?
[07:16:37] basichash: sivsushruth: thanks again

2015-02-19

[19:00:06] basichash: I'm trying to get livereload working, but it doesn't seem to refresh my page (despite saying it has in console)
[19:09:58] basichash: tbuehlmann: right so i've installed guard, guard-livereload and rack-livereload, created the Guardfile and then bundle exec guard
[19:10:55] basichash: then when i save a view/index.html page for instance, i get the Reloading browser: app/views/view/index.html.erb, but it doesn't actually refresh my page
[19:11:15] basichash: tbuehlmann: different guy
[19:11:22] basichash: that would be oddover
[19:11:40] basichash: i'm talking about the livereload gem
[19:15:27] basichash: tubbo: yeah, although i was going to try with rack-livereload. I get "Could not connect to LiveReload server" when i click on the extension icon in chrome
[19:17:41] basichash: i'm on ubuntu bts
[19:18:18] basichash: bricker: it sounds pretty convenient, especially when changing your site design
[19:20:34] basichash: i'm having issues getting it wokring on ubuntu
[19:24:42] basichash: can someone give me a hand with this?
[19:31:44] basichash: stupid shit isn't working
[22:34:18] basichash: is there a gem that has postcodes for each country?
[22:36:06] basichash: countries doesn't support postcodes, and as far as i can tell, neither does country_select
[22:37:24] basichash: Radar: i want my users to be able to enter a postcode for my BDSM-as-a-service app
[22:38:23] basichash: hoping there was a gem for this, google it is
[22:41:03] basichash: pipework: nothing that detailed, just a rough approximation of area. I developed an app last year that had that sort of radius functionality, but i shouldn't need it for this situation
[22:43:02] basichash: pipework: i'll just use maps api to translate the postcode into state
[22:45:22] basichash: pipework: it's a premium BDSM-as-a-service app, so the doms won't mind travelling a few more hours as the price will justify it
[22:45:29] basichash: pipework: also it's not a dating app
[22:46:44] basichash: pipework: the doms select in which states they're happy to work
[22:47:07] basichash: thus fencing is not really necessary
[23:00:43] basichash: pipework: to be honest i don't trust the dom's enough to let them decide something so specific. That stuff hurts their heads

2015-02-18

[15:20:29] basichash: How do you guys deal with hitting development walls? (e.g. you can't think of a great solution to a problem?)
[15:29:09] basichash: rushed: good advice, just seems like every solution presents another problem
[15:52:13] basichash: how do I reimplement a model without it breaking my current data? e.g. I want to rename most fields of a model and also add several new fields
[15:57:13] basichash: sivsushruth: is there a way to do it without creating a new app?
[15:59:43] basichash: t4nkd: is that a long-term solution? btw my app is still in development, it's just i've spent a while adding test data (which i now see i should've done as fixtures)
[16:01:03] basichash: t4nkd: that's basically what i want to change, the underlying db column names
[16:03:16] basichash: screw it i'll just recreate the model
[16:04:22] basichash: man i dunno
[16:18:17] basichash: is there a timestamp field in rails?
[16:18:42] basichash: is that just a datetime type?
[16:19:15] basichash: rushed: for postgres?
[16:20:07] basichash: ah. i assume when saving a column name with AR as column_name:datetime, it's a timestamp though?
[16:21:57] basichash: as in unix timestamp
[16:22:35] basichash: i suppose it's irrelevent anyway, i mean it stores the date and time of an event, that's all i should worry about
[16:23:39] basichash: rushed: is it possible to store a json object in postgres?
[16:23:54] basichash: e.g. something like add_column :model, :object, :json?
[16:26:38] basichash: rushed: basically it's too keep a list of arbitrary data about a model instance, for example if i have a Person model, the field is extra: { haircolor: "black", eyecolor: "blue", legs: 3 }
[16:26:52] basichash: i guess the json type is what i need
[16:41:52] basichash: how do I override rails' standard primary key allocation (to id)?
[16:42:20] basichash: e.g. instead of id=25, i want to generate a string, e.g. id="aJXDubaSS728"
[16:45:36] basichash: smathy: will it reduce performance?
[16:45:49] basichash: as opposed to using integers?
[16:48:49] basichash: smathy: is it possible to set the id to a string object when it's created? e.g. a SecureRandom.hex value?
[16:53:52] basichash: rushed: basically i need a public version of an id, that's not the actual id
[16:54:18] basichash: also needs to be unique
[16:55:18] basichash: rushed: so a hashed slug? the model itself is for a transaction, not sure how relevant that is
[16:55:57] basichash: rushed: what else would the slug be?
[16:56:33] basichash: hash as in a random set of characters
[16:57:15] basichash: rushed: yeah should've made that clear, but a SecureRandom.hex would do the job, no?
[16:58:48] basichash: rushed: would add_column :transactions, :slug, :string, default: SecureRandom.hex[0..16] work?
[16:59:15] basichash: *add_column :transactions, :slug, :string, unique: true, default: SecureRandom.hex[0..16]
[17:01:02] basichash: workmad3: to be honest a lot of other transaction-like tables seem to use it
[17:02:20] basichash: workmad3: i don't know, but considering some well established companies are using it, i assumed there must be a good reason
[17:08:18] basichash: workmad3: not in this instance
[17:15:24] basichash: workmad3: if i'm building a developer api should i not use slugs?
[20:47:21] basichash: i renamed a column in PG, and now i'm getting a PG::UndefinedColumn: ERROR: column "price" does not exist error
[20:47:37] basichash: i've checked through the model instances and can't find one with a 'price' field
[20:48:35] basichash: also rebooted by server, didn't make a difference
[22:49:59] basichash: How can I change my default database from PG 9.3 to 9.4?
[22:52:06] basichash: sivsushruth: how can i find th elocation of postgres?
[22:54:38] basichash: is it /usr/lib/postgresql?

2015-02-17

[18:08:03] basichash: batasrki: thanks
[18:15:57] basichash: is rspec deprecated?
[18:16:15] basichash: should i be using it for my tests?