taxen

Activity Graph

Page 1 of 2 | Next »

2018-05-09

[21:00:31] taxen: has joined #RubyOnRails
[21:05:35] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-06-19

[11:45:31] taxen: has joined #RubyOnRails
[12:28:23] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-06-14

[21:22:04] taxen: has joined #RubyOnRails
[21:24:29] taxen: I'm trying to deploy my first rails app to my ubuntu server (running nginx + unicorn)... I've setup everything but only get a "we're sorry but something went wrong" error when visiting the IP... Where do I start troubleshooting this?
[21:25:31] taxen: I've checked in log/unicorn.log but no error there
[21:27:24] taxen: norc_ where is it located?
[21:27:43] taxen: where is it normally located? :)
[21:27:48] taxen: (complete noob here)
[21:30:49] taxen: roamingdog: only a few entries from when I ran db:migrate there
[21:32:42] taxen: roamingdog: yeah, it's strange... there's production.log and unicorn.log
[21:32:54] taxen: as well as development.log and test.log, but those are empty
[21:33:08] taxen: strange that there's no error in production.log I mean
[21:34:25] taxen: roamingdog: /var/log/nginx/nginx_error.log is empty
[21:35:29] taxen: please bear with me
[21:35:52] taxen: my rails app is in /home/username/
[21:36:04] taxen: (running ubuntu)
[21:37:04] taxen: roamingdog: ok, I found something in /var/log/nginx/error.log
[21:37:18] taxen: 2016/06/14 22:36:05 [notice] 29120#0: signal process started
[21:37:18] taxen: 2016/06/14 18:08:46 [notice] 16439#0: using inherited sockets from "6;"
[21:37:27] taxen: that's all
[21:58:07] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-06-05

[18:43:41] taxen: has joined #RubyOnRails
[18:50:27] taxen: This line is giving me a "undefined method 'where' for #<Game>" error... what should it be instead?
[18:50:28] taxen: if game = Game.where("id = ? AND start <= ?", params[:game_id], DateTime.now)
[18:56:52] taxen: jhass: oh, I thought this was ok syntax
[18:57:24] taxen: this is the first line of the method
[18:59:46] taxen: I just have validates :start, presence: true on the model, that's it
[19:00:05] taxen: no other definition
[19:00:18] taxen: class Game < ActiveRecord::Base
[19:01:32] taxen: https://gist.github.com/anonymous/30f9066333c676fdb0526bf04693c30c
[19:03:40] taxen: jhass: problem remains
[19:15:40] taxen: ah jhass I found it what was wrong... thanks though!
[19:18:43] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-05-22

[11:51:13] taxen: has joined #RubyOnRails
[11:52:34] taxen: Hello everyone. I have a model that are referencing another model in two attributes (new_product_id, old_product_id). How can I validate and make sure you can't select the same product id?
[11:54:23] taxen: tbuehlmann: I was fearing that (never done it before). Isn't there a way to use validates_uniqueness_of though?
[12:00:31] taxen: tbuehlmann: yeah, so this "Group" model has two attributes; old_product_id and new_old_id - just need those two to be different from each other
[12:11:34] taxen: tbuehlmann: thanks man, will do
[12:17:58] taxen: tbuehlmann: beautiful solution, thank you!
[13:03:39] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-05-06

[20:40:21] taxen: has joined #RubyOnRails
[20:41:22] taxen: Hey all. If I pass an empty array as an argument in my api call, rails interpret it as nil and causes my validation to fail. Any ideas on how to work around this?
[20:43:29] taxen: mordof: I'm using apipie and it's catching it before I get a chance to take a look at it myself..
[20:45:06] taxen: mordof: however, I found that you can disable deep munging in rails
[20:45:22] taxen: but does that put me at risk, security wise?
[20:45:51] taxen: no idea :)
[21:07:19] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-02-14

[09:37:14] taxen: has joined #RubyOnRails
[09:39:21] taxen: Hey. I have the following models; User, Property and Membership. User has_one property and Property has_many users. I'm trying to get this working with a through association, but both user.property and property.users returns nil. What should it be instead?
[09:40:31] taxen: fox_mulder_cp: yeah, that's what I have on Property
[09:40:39] taxen: has_many :users, :through => :memberships
[09:41:52] taxen: fox_mulder_cp: https://gist.github.com/anonymous/c7feec3c3606d77388a4
[09:44:49] taxen: fox_mulder_cp: Sorry, I just realized what's wrong
[09:45:04] taxen: accidentally created the membership with wrong user_id on it
[09:45:10] taxen: *facepalm*
[09:48:11] taxen: fox_mulder_cp: :)
[09:48:16] taxen: thanks for the help though
[09:59:40] taxen: Ping timeout: 256 seconds
[16:29:56] taxen: has joined #RubyOnRails
[16:35:40] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-02-13

[17:03:46] taxen: has joined #RubyOnRails
[17:12:49] taxen: Quit: Textual IRC Client: www.textualapp.com
[17:31:53] taxen: has joined #RubyOnRails
[18:01:06] taxen: I have three models; User, Property and Membership. The user is has_one :membership and has_one :property, :through => :membership, the property is has_many :memberships and has_many :users, :through => :memberships. Membership is just connecting the two with belongs_to.. Why is the list empty when I do property.users?
[18:10:09] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-01-30

[13:08:49] taxen: has joined #RubyOnRails
[13:12:39] taxen: Hey guys. I'm trying to write a method that recieves a base64 image and should write this file to this, via Carrierwave.
[13:12:44] taxen: So far I have this:
[13:12:45] taxen: https://gist.github.com/anonymous/ea896ce0a9a37bc88121
[13:13:00] taxen: file to disc*
[13:13:48] taxen: My Avatar model have the Carrierwave ImageUploader mounted to it
[13:15:11] taxen: Now I'm struggling to understand how to create an avatar object and get the file connected to the image uploader.
[13:18:14] taxen: Any suggestions?
[18:04:29] taxen: Quit: Textual IRC Client: www.textualapp.com
[22:52:20] taxen: has joined #RubyOnRails
[23:57:02] taxen: Quit: Textual IRC Client: www.textualapp.com

2016-01-29

[20:31:55] taxen: has joined #RubyOnRails
[20:39:29] taxen: I'm trying to setup an Avatar model that will have a carrierwave uploader mounted to it. The avatar will be shared by both a User model and a Team model, but I can't work out what the relationships should be. Any suggestions?
[20:44:43] taxen: arup_r: both user and team should have an avatar. I was first thinking something along the lines where Avatar would have both belongs_to :user and belongs_to :team, but that's not really the right way, is it?
[20:47:13] taxen: that's it! thanks guys! smathy arup_r
[22:17:25] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-12-19

[00:00:00] taxen: isn't the view irrelevant
[00:01:47] taxen: Papierkorb: true :)
[00:02:11] taxen: matthewd: because somehow email ends up there
[00:02:42] taxen: matthewd: im new to rails
[00:06:02] taxen: matthewd: you were right - wrapping it inside a user hash did it
[00:06:24] taxen: still no idea why email would show up with the other way I had it though
[00:07:27] taxen: matthewd: ahh, that explains it
[00:07:36] taxen: thank you for your help
[00:09:39] taxen: yeah, building my own hash and grabbing the values straight from params worked, but is that really the right/safe way to go about it?
[00:14:23] taxen: Quit: Textual IRC Client: www.textualapp.com
[12:11:26] taxen: has joined #RubyOnRails
[13:03:53] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-12-18

[23:39:52] taxen: has joined #RubyOnRails
[23:42:03] taxen: Hey. I'm trying to use strong parameters for a create method with email and password, but keep getting a "password cant be blank" error. Even though I have permitted it. What could be the cause?
[23:42:38] taxen: When debugging it, I see the password in params[:password]
[23:42:56] taxen: Papierkorb: sure, 1 sec
[23:44:08] taxen: Papierkorb: https://gist.github.com/anonymous/a9c1966f2eeccd9d3e1d
[23:45:10] taxen: I'm using Sorcery with this btw
[23:48:45] taxen: https://gist.github.com/anonymous/c890b7c8de239607a634
[23:48:45] taxen: Papierkorb: here's a combined gist with the model
[23:50:56] taxen: Papierkorb: fair enough. assuming it doesnt affect that part of the app, do you see anything else that could be the problem?
[23:56:20] taxen: Papierkorb: hmm, I just noticed something strange in the debug
[23:56:24] taxen: Here's the hash:
[23:56:25] taxen: {"email"=>"max3@max.com", "password"=>"maxmaxmax", "format"=>"json", "controller"=>"api/v1/users", "action"=>"create", "user"=>{"email"=>"max3@max.com"}}
[23:56:49] taxen: password is not within the user's hash
[23:57:18] taxen: I'm testing this through a simple curl
[23:57:24] taxen: passing the data like this: -d '{"email":"max3@max.com", "password":"maxmaxmax"}'
[23:59:13] taxen: Papierkorb: any ideas how that could be?

2015-10-18

[12:25:55] taxen: has joined #RubyOnRails
[12:28:58] taxen: I have User, Membership and Group model. Membership has a "has_accepted" boolean field. Group is has_many through membership - user is has_many groups through membershop. I want to select all groups where a user has accepted a membership. Any ideas?
[12:44:27] taxen: tbuehlmann: yeah, I'd like to query all groups a user has a membership to where the "has_accepted" flag on the membership is true
[12:45:11] taxen: tbuehlmann: a given user. not a specifc one :)
[12:55:35] taxen: tbuehlmann: thanks, works like a charm
[13:57:42] taxen: Quit: My MacBook Pro has gone to sleep. ZZZzzz???
[20:29:25] taxen: has joined #RubyOnRails
[20:44:15] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-10-17

[12:10:51] taxen: has joined #RubyOnRails
[12:12:32] taxen: What's wrong with the following line: Tournament.where("end < ?", Date.today)
[12:12:35] taxen: (end is a datetime field)
[12:12:40] taxen: I'm getting erros in IRB
[12:16:36] taxen: LINE 1: SELECT "tournaments".* FROM "tournaments" WHERE (end > '2015...
[12:16:36] taxen: PG::SyntaxError: ERROR: syntax error at or near "end"
[12:16:55] taxen: tbuehlmann: ^^
[12:17:59] taxen: arup_r: ok. is start a keyword as well?
[12:18:42] taxen: arup_r: hm, yeah, that seems to be the problem. "start < ?", ... works
[12:19:04] taxen: arup_r: yeah, I just tried changing the < around
[12:19:09] taxen: same error
[12:23:09] taxen: https://gist.github.com/anonymous/20906614b6c1f54e1b42
[12:23:09] taxen: tbuehlmann: ok, that must be why. I'm using pg.
[12:23:31] taxen: tbuehlmann: no scopes that I know of :)
[12:23:58] taxen: it's a bit vauge
[12:24:09] taxen: I should probably change it
[12:24:37] taxen: thanks guys
[12:25:50] taxen: I agree it should be a bit more specific
[12:26:03] taxen: have any of you used simple_token_authentication gem? I'm having issues getting the token to update when creating or signing in users.
[12:26:39] taxen: tbuehlmann: yep, works.
[12:28:42] taxen: tbuehlmann: simple_token_authentication? ^^
[15:13:00] taxen: Quit: Textual IRC Client: www.textualapp.com
[22:53:41] taxen: has joined #RubyOnRails
[23:25:27] taxen: I have the following models; Group, User, Game and Bet. Users can belong to different groups and can place bets on games. Now I'm struggling with the query to list all bets that have been placed in a certain game by the users in a specific group. I suspect I'll have to use something lilke a WHERE IN on the game object...?
[23:26:51] taxen: FailBit: thanks
[23:52:49] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-10-16

[18:50:54] taxen: has joined #RubyOnRails
[18:51:29] taxen: Anyone here have experience with devise-ios-rails gem? I'm having issues getting the token to update.
[18:54:34] taxen: tubbo: speaking of Devise... :) have you used devise-ios-rails?
[19:06:08] taxen: tubbo: yeah, fair enough. It's just that I wouldn't expect anyone without experience of it to know what could be wrong.
[19:06:18] taxen: Anyway, here we go;
[19:07:00] taxen: I have succesfully installed devise-ios-rails, but authentication_token isn't re-generated on login, or sign up. Does anyone have any pointers as to what could be the problem?
[19:07:59] taxen: tubbo: ^^
[19:08:03] taxen: helpa: ^^
[19:09:10] taxen: tubbo: yes, I have followed their tutorial in detail
[19:11:21] taxen: tubbo: yes. I have tried downgrading to other versions of the gem to see if that would solve the problem.
[19:42:08] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-10-11

[13:12:47] taxen: has joined #RubyOnRails
[13:57:54] taxen: Quit: My MacBook Pro has gone to sleep. ZZZzzz???
[14:57:18] taxen: has joined #RubyOnRails
[14:58:41] taxen: Client Quit

2015-10-10

[11:51:23] taxen: has joined #RubyOnRails
[11:53:21] taxen: I have a Team model and now want to add a Game model that should contain a home_team and away_team reference. I get an error when trying to run rake db:migrate saying "ERROR: relation "home_teams" does not exist"... What should my migration file look like?
[11:54:09] taxen: rails generated two lines like this in the migration: t.references :home_team, index: true
[12:00:12] taxen: gerep: right, how can I use two references to the same model then?
[12:01:28] taxen: gerep: ok, how do you recommend I approach this problem?
[12:02:00] taxen: Sure, 1 sec
[12:02:48] taxen: gerep: http://pastebin.com/C05MGxX5
[12:03:56] taxen: gerep: hehe, sorry, here you go: https://gist.github.com/anonymous/135a13f054f2d46760fb
[12:04:56] taxen: gerep: here's the correct url https://gist.github.com/anonymous/1eb80f8e582f083a3c45
[12:10:23] taxen: gerep: I think the problem is "t.references :home_team, index: true" since rails thinks there's a model called home-_team..
[12:10:44] taxen: gerep: but I have no idea what the syntax should be instead
[12:25:00] taxen: gerep: yeah, agreed. right now I'm trying to get db:migrate to pass though. I added add_foreign_key :games, :teams, column: :home_team_id to the migration and that seemed to work... but I'm unsure it's the right way?
[12:32:16] taxen: Quit: My MacBook Pro has gone to sleep. ZZZzzz???
[21:24:55] taxen: has joined #RubyOnRails
[21:33:55] taxen: Anyone here have experience using multiple references of a model on another model?
[21:35:03] taxen: Radar: was that for me?
[21:42:28] taxen: has joined #ruby
[21:43:17] taxen: Hey everyone. Is it ok to ask Rails related questions here?
[21:43:51] taxen: havenn: yeah, but not alot of activity there at the moment
[21:56:33] taxen: Radar: ok, well, I'm a noob and have a bit more complex problem...
[21:57:10] taxen: true, but at the moment I'm lost
[21:57:17] taxen: I'll explain
[22:00:26] taxen: I have a Game model and a Team model... game model contains home_team and away_team references (using belongs_to :home_team, :class_name => 'Team' etc). On the team model, I have has_many :home_games, :class_name => 'Game', :foreign_key => 'home_team_id' and the same for away_games, but ideally I'd like to be able to do Team.games and combine all instances where a Team is either home or away. Does that make sense?
[22:01:40] taxen: helpa: ^^
[22:01:48] taxen: Radar: ^^
[22:02:05] taxen: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[22:04:13] taxen: Radar: thank you very much, works like a charm
[22:04:29] taxen: Radar: Is it the best way though?
[22:21:39] taxen: VeryBewitching: when generating a model with a reference to another model... Is there a way to rename that property? For example; A user can create a tournament. I'd like this reference to be called founder_id on the model instead of user_id.
[22:23:03] taxen: VeryBewitching: OK, so it's not something you'd put in the rails g model command?
[22:23:48] taxen: VeryBewitching: cool
[22:35:42] taxen: gambl0re: first year is free
[22:37:44] taxen: VeryBewitching: not sure how I should go about generating my group model... a group has a creator (user object) and also has a bunch of invited users tied to it. Any ideas?
[22:42:07] taxen: VeryBewitching: cheers
[22:44:54] taxen: VeryBewitching: I'm thinking there's probably some way rails would set that up for me, that I'm just unaware of
[22:45:27] taxen: VeryBewitching: if all relationships are properly defined
[22:47:38] taxen: VeryBewitching: allright, I'll give it a try
[22:47:42] taxen: VeryBewitching: thanks
[22:49:39] taxen: Yeah.. I'm only starting out
[22:49:45] taxen: This is my first serious rails project
[22:49:55] taxen: Love RoR already
[23:22:15] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-09-19

[13:54:20] taxen: has joined #RubyOnRails
[13:57:01] taxen: Noob question; is it generally better to split up things into different models - like an address for example. That could be a Address model containing some fields (zipcode etc) PLUS a Location model (lat, long) tied to it. Or is that performance heavy?
[14:23:07] taxen: Thanks FailBit
[15:25:12] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-09-13

[16:33:53] taxen: has joined #RubyOnRails
[16:34:43] taxen: Client Quit

2015-06-21

[12:19:13] taxen: has joined #RubyOnRails
[12:28:52] taxen: Hey everyone. I'm trying to mix a javascript variable into an image_tag (in my javascript file), like this: var path = 'sections/about/' + id + '-profile.jpg';
[12:28:53] taxen: var html = '<%= image_tag("' + path + '")%>'; but the variable is not read properly... What am I doing wrong?
[13:22:27] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-05-30

[12:39:07] taxen: has joined #RubyOnRails
[13:11:25] taxen: Anyone here have experience with the StripeJS gem?
[14:19:08] taxen: Quit: Textual IRC Client: www.textualapp.com
[21:53:54] taxen: has joined #RubyOnRails
[23:16:58] taxen: Quit: Textual IRC Client: www.textualapp.com

2015-05-16

[17:38:45] taxen: What's the best data type for storing a users age with Postgres? Smallint?

2015-05-13

[21:19:18] taxen: Hey everyone! What's the best way to migrate a postgres database onto my Digitalocean server?
[21:45:24] taxen: @smathy hmm, when I try to pg_restore it, I get an error about the role not exisiting on my remote server
[21:45:33] taxen: (I have a different username there)
[21:47:23] taxen: is there a way to specify the role with an argument or something?

2015-04-22

[18:14:32] taxen: I'm getting this error when trying to run rails server
[18:14:34] taxen: undefined method `[]' for nil:NilClass
[18:14:34] taxen: (erb):20:in `<main>': Cannot load `Rails.application.database_configuration`: (NoMethodError)
[18:15:04] taxen: My database.yml is referencing secrets.yml for production
[18:15:53] taxen: Locally I'm just extending the default and giving it a name for db
[18:16:00] taxen: What could be wrong?
[18:17:05] taxen: If I remove the references to secrets.yml, it's working again
[18:17:21] taxen: Is there a way to keep them in there?
[18:23:13] taxen: @bricker seems to be working when I deploy, using Capistrano
[18:23:57] taxen: @pipework yeah, I wanted to use env vars, but Capistrano was being such a bitch
[18:29:13] taxen: @bricker is there a way to say "use this value from this secrets.yml prop, if it's loaded or else X" ?
[18:33:20] taxen: looks like the following is ok:
[18:33:21] taxen: database: <%= Rails.application.secrets[:database]['name'] if Rails.env.production? %>

2015-04-21

[20:13:49] taxen: I can't get my ENV variables to work with Capistrano... could anyone guide me? Please!

2015-04-20

[21:02:15] taxen: following Dotenv.load
[21:07:59] taxen: @tubbo just tried it. didnt work. I'm using ENV variables in database.yml and that's where it's breaking on deploy at the moment.
[21:08:35] taxen: however, before :deploy, :dotenv suggests there's is a dotenv task defined in deploy.rb, correct?
[21:09:37] taxen: @tubbo yeah, tried requiring that too
[21:09:45] taxen: I'll keep digging