« Back to channel list

#RubyOnRails - 09 January 2016

« Back 1 day Forward 1 day »
[00:00:47] djbkd: has joined #RubyOnRails
[00:01:28] snguyen: has joined #RubyOnRails
[00:03:53] djbkd: has joined #RubyOnRails
[00:04:34] snowy: has joined #RubyOnRails
[00:04:49] StevenXL: I have that book. It's freaking incredible.
[00:05:00] choke: has joined #RubyOnRails
[00:05:04] diegoviola: so I have this import_data.rake task that we use to import our data, but I want to check that no duplicates are ever saved: https://gist.github.com/diegoviola/cb446e462ff24198b300
[00:05:07] diegoviola: any ideas how to do this?
[00:05:14] StevenXL: A+ would buy again. On a more serious note, Radar that is a really great book.
[00:05:26] diegoviola: the rake task is working though
[00:06:05] Radar: stevenxl: Aw thanks :)
[00:06:25] Radar: diegoviola: what is the unique id of each row?
[00:06:38] rhizome: diegoviola: find_or_create, find_or_initialize
[00:07:44] Sonicrida: has joined #RubyOnRails
[00:08:01] kies^: has joined #RubyOnRails
[00:08:16] diegoviola: Radar: sorry, I don't understand that question
[00:08:28] Radar: diegoviola: How do you determine if a row has been imported before?
[00:08:35] Radar: Surely there has to be some sort of ID that is unique to each row
[00:08:38] Radar: like tracking? What is tracking?
[00:08:49] diegoviola: tracking is just a date
[00:09:08] diegoviola: it's a timestamp
[00:09:18] diegoviola: but formated this way: %Y%m%d%H%M%S
[00:09:30] diegoviola: they use that to identify tracking for their correspondences
[00:09:47] Radar: So find by that timestamp + sender + receiver
[00:09:53] Radar: that is probably enough unique information to go on
[00:10:32] xnp70: has left #RubyOnRails: ()
[00:11:03] jklass: has joined #RubyOnRails
[00:11:54] nettoweb: has joined #RubyOnRails
[00:12:20] mices: for steps, like review before submit, are hidden fields good enough or is there a better approach, is that what service objects are for?
[00:12:57] diegoviola: I can't believe parsing HTML took me this much effort, I need to practice more
[00:13:21] cvikvi: has joined #RubyOnRails
[00:13:24] snowy: has joined #RubyOnRails
[00:14:00] lacuna: has joined #RubyOnRails
[00:16:02] Bloomer: has joined #RubyOnRails
[00:16:18] choke: has joined #RubyOnRails
[00:18:34] nerium: has joined #RubyOnRails
[00:19:07] nerium: How do I enable the ???should??? syntax when using rspec?
[00:19:07] nerium: I???m getting this error https://gist.github.com/oleander/84fd4d7bf47c08a61af4
[00:19:27] diegoviola: rhizome: you mean #find_or_create_by?
[00:19:32] brycesenz: mices - you can use a confirmation box on a form submit if that's all you need
[00:20:52] rhizome: diegoviola: yep, or where(...).first_or_create/initialize (more current syntax)
[00:22:02] artX000: has joined #RubyOnRails
[00:23:33] StevenXL: Hi everyone. I'm running into a bit of a problem here. I have a Wine model that belongs_to a Varietal model. When a user creates a Wine model, they can choose from a current set of varietals. That's no problem. However, when a user edits a Wine model, I want the current Varietal to be automatically selected in teh drop-down.
[00:23:38] StevenXL: How can I do that?
[00:24:13] Radar: stevenxl: It should be done by default. If not, show us your code.
[00:24:18] Radar: stevenxl: particularly the view
[00:24:26] Radar: nerium: Use the new syntax
[00:24:38] brycesenz: stevenxl - http://stackoverflow.com/questions/623458/rails-select-helper-default-selected-value-how, but Radar is right, it should be automatic
[00:24:44] nerium: Radar: Eventually, for now I want to use the old one
[00:24:45] Radar: nerium: allow(Askimetor).to receive(:spam?) { true }
[00:24:55] Makorak: has joined #RubyOnRails
[00:25:15] penguinp1wernz: has joined #RubyOnRails
[00:25:41] Radar: nerium: http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ See the bottom of this blog post, Configuration options, that I found googling for "rspec should syntax".
[00:25:51] choke: has joined #RubyOnRails
[00:26:19] smathy: nerium, ...but use the new syntax.
[00:26:45] nerium: Radar: That will only work with x.should eq .., not should_receive
[00:26:49] smathy: ...and http://yujinakayama.me/transpec/ will convert from old to new.
[00:27:02] nerium: smathy: Eventually I will
[00:27:43] StevenXL: Radar, brycesenz here is the _form partial: https://gist.github.com/StevenXL/4a909d7d177f31657df8
[00:28:09] diegoviola: rhizome: I can't really do #where as my Correspondence model will be empty when this runs for the first time
[00:28:27] StevenXL: I think that I'm probably not utilizing the FormBuilder object correctly, and instead setting the dropdown with a select_tag.
[00:28:34] brycesenz: stevenxl - I believe it's because you're using "select_tag" instead of "f.select"
[00:28:38] Sawbones: has joined #RubyOnRails
[00:28:39] diegoviola: rhizome: the idea is to run this rake task every 15 minutes
[00:28:44] roshanavand: has joined #RubyOnRails
[00:29:27] snowy: has joined #RubyOnRails
[00:32:18] StevenXL: brycesenz: thanks - I'll take a look at that. FormBuilder API as I do not know how to use f.select
[00:32:21] shibabu: has joined #RubyOnRails
[00:33:46] snowy: has joined #RubyOnRails
[00:34:04] choke_: has joined #RubyOnRails
[00:35:08] brycesenz: stevenxl - it's really not much different than the "f.text_field" calls that you're using now
[00:35:44] brycesenz: stevenxl - it just makes use of that actual form object, which has access to the attributes of the model that you've provided it
[00:36:18] lacuna: has joined #RubyOnRails
[00:36:42] Radar: diegoviola: huh?
[00:36:46] Radar: diegoviola: where will return no results
[00:36:51] Radar: diegoviola: So then it will create the records
[00:36:56] penguinp1wernz: has joined #RubyOnRails
[00:36:57] Radar: diegoviola: next time it runs, it will see that it exists, so it won't do anything
[00:37:07] StevenXL: brycesenz, Radar thanks. You are both correct; I had to use f.select
[00:37:53] diegoviola: Radar: yeah I got confused
[00:38:07] choke: has joined #RubyOnRails
[00:38:16] diegoviola: damn I need to fix my eyes
[00:38:30] diegoviola: I read that as #find_or_create
[00:38:51] diegoviola: I think I'm myopic
[00:38:56] lacuna: has joined #RubyOnRails
[00:41:20] choke__: has joined #RubyOnRails
[00:41:45] eljimmy: has joined #RubyOnRails
[00:44:00] speaking1ode: has joined #RubyOnRails
[00:44:02] choke_: has joined #RubyOnRails
[00:44:25] hannelita: has joined #RubyOnRails
[00:45:36] StevenXL: man - there is so much to learn in Rails.
[00:46:40] FailBit: try ruby first
[00:49:21] choke_: definitely knowing ruby helps... trying to learn a framework, before the language it was written in is like a lesson in futility
[00:49:24] blackmes1: has joined #RubyOnRails
[00:50:04] FailBit: I was raised in rails
[00:50:08] FailBit: I learned ruby along the way
[00:50:15] FailBit: I do not recommend this if you are new to programming
[00:50:31] FailBit: for me, I love learning new things and I tend to pick up concepts very quickly
[00:51:21] choke_: I started with ruby ( the basics -- enough to understand the syntax really ) and moved into rails... and have kept learning the ruby way since
[00:51:51] lexileo: has joined #RubyOnRails
[00:52:01] Radar: Started with Rails, learned Ruby afterwards by doing Ruby Koans and a few little Ruby projects
[00:52:07] choke_: but knowing other languages ( especially OOP languages ) does help with learning
[00:52:12] Radar: definitely recommend learning Ruby first
[00:52:22] FailBit: before Ruby I was C++
[00:52:27] leonardoajim: has joined #RubyOnRails
[00:52:44] FailBit: (and C, because I preferred C to C++ so much)
[00:53:07] FailBit: before that I was a beginner programmer
[00:53:14] FailBit: I used VB.NET and C#
[00:53:26] FailBit: made some pointless / shitty desktop apps
[00:53:27] choke_: I came here directly from PHP, but over 20 years i've learned a lot of languages...
[00:53:46] FailBit: I've picked some up along the sides due to project requirements, too
[00:53:53] choke_: had to write some PHP just recently -- i don't want to do that anymore
[00:54:03] diegoviola: when I use Correspondence#create(...) all my data is imported just fine, but when I use Correspondence.where(...).first_or_create(...) I get this for some reason:
[00:54:03] FailBit: for example the rails project I'm currently involved with (derpibooru) has some python code for image processing
[00:54:04] diegoviola: PG::DatetimeFieldOverflow: ERROR: date/time field value out of range: "20160107085332"
[00:54:06] diegoviola: HINT: Perhaps you need a different "datestyle" setting.
[00:54:24] FailBit: diegoviola: did you mean find_or_create?
[00:54:26] Radar: You need to convert it
[00:54:29] Radar: diegoviola: Date.strptime
[00:55:07] droptone: Question: I have a users table with a column userid, and I'm using Devise with a Rails 3.2 project. I need to, on new user create, determine the highest-current userid and assign the next increment up to the new user.
[00:55:11] droptone: Any thoughts there?
[00:55:20] diegoviola: FailBit: I think it's first_or_create and find_or_create_by, right?
[00:55:37] droptone: As long as everything works properly I could pull User.last, get its userid value, increment it, and assign it to the new user.
[00:55:46] StevenXL: I know Ruby to the level of an advanced beginner, but I can't say that has has helped me much with Rails. I mean, for Rails you simply have to know the APIs, options, etc. There's so much of it. It's true for Ruby as well, but there's a lot less, and it's also a lot simpler.
[00:55:55] droptone: Part of the question is how to do such, I've determined how to assign cookies on Devise logon/logoff using Warden calls in devise.rb.
[00:56:08] nettoweb: has joined #RubyOnRails
[00:56:28] choke_: primary_key and auto increment is your friend droptone
[00:56:30] FailBit: stevenxl: I've been working a lot more in pure ruby recently, oddly enough
[00:56:33] smathy: droptone, you should configure your database to do that for you.
[00:56:34] FailBit: been writing some libs
[00:56:36] FailBit: compilers, etc
[00:56:50] diegoviola: Radar: convert the dates before storing in into progress you mean?
[00:56:50] droptone: samthy: Thank you, how would that occur?
[00:56:59] diegoviola: storing into*
[00:57:01] Radar: diegoviola: yes
[00:57:06] diegoviola: Radar: ok let me try that, thanks
[00:57:31] DonOtreply: has joined #RubyOnRails
[00:57:38] smathy: droptone, depends on the database, but first let me ask, is this a legacy DB or something? I'm asking because the default primary key for the Rails generators is `id` not `userid`, so I'm wondering how you created it that way in the first place?
[00:58:04] droptone: It's for this cheap plugin "CometChat" a client requested we deploy.
[00:58:15] droptone: The DB is just a MySQL DB, this is separate from the id column.
[00:58:33] smathy: droptone, well, why have it separate from the id column?
[00:58:35] droptone: they need a unique userid column, and I've manually created the column, populated it for existing users, and now have cookies set on user logon / logoff with devise.
[00:58:35] Radar: droptone: Why can't you use the id column?
[00:58:53] droptone: hah, well, I suppose I could simply populate it with the id column.
[00:58:54] choke_: yeah since the id and userid are essentially going to be the exact thing -- just use id
[00:59:01] droptone: Ok, I'll do that, thanks.
[00:59:08] smathy: droptone, np.
[00:59:35] smathy: ACTION gives Radar an awkward high five that half misses and then walks away awkwardly
[01:01:10] StevenXL: OK guys, I'm off to learn how to create a Rails API. I think it's easy but I've never done it.
[01:01:21] StevenXL: Luckily the New York Public Library provides access to Lynda.com for free.
[01:01:28] diegoviola: how can I find out what's the format that postgres is expecting?
[01:01:47] diegoviola: for the date
[01:01:50] StevenXL: diegoviola: can you connect to postgress via psql?
[01:02:03] Radar: diegoviola: it'd be 2015-12-31 17:59:59
[01:02:04] Radar: for instance.
[01:02:17] guacamole: has joined #RubyOnRails
[01:02:46] diegoviola: ah well, I think the problem is that some of the datetimes are nil
[01:02:52] diegoviola: not sure how to deal with that
[01:03:04] Radar: Leave them as nil
[01:04:26] diegoviola: I'm thinking it's just the tracking that I need to format properly then, but that is a datetime already
[01:05:03] sankaber: has joined #RubyOnRails
[01:05:13] chipotle: has joined #RubyOnRails
[01:06:06] pawnbox: has joined #RubyOnRails
[01:06:41] StevenXL: what the heck can this possibly mean: demonstrate your API calls using RSpec tests
[01:06:58] rickmasta: has joined #RubyOnRails
[01:08:47] choke: has joined #RubyOnRails
[01:10:52] diegoviola: Radar: you were right, the date is coming as a string like this from that XLS
[01:10:56] diegoviola: => [{"tracking"=>"20160107085332",
[01:11:05] gambl0re: has joined #RubyOnRails
[01:11:21] brycesenz: has joined #RubyOnRails
[01:12:39] diegoviola: for some reason the #create method in AR converts it to a proper datetime though
[01:12:54] diegoviola: and I don't get that error
[01:13:21] diegoviola: I'll format it properly anyway, more safe
[01:15:11] a1fa: uh, this is so frustrating.. i have something redirecting an action to a whole different controller
[01:15:46] arBmind1: has joined #RubyOnRails
[01:16:04] a1fa: is there anyway to put line codes into production log?
[01:17:02] Bloomer: has joined #RubyOnRails
[01:17:26] choke: I usually use Rails.logger which seems to work unless my logs rotate and permissions are screwed up
[01:20:58] diegoviola: [12] pry(main)> DateTime.strptime("2016-01-07 08:53:32", "%Y-%m-%d %H:%M:%S")
[01:20:59] diegoviola: => Thu, 07 Jan 2016 08:53:32 +0000
[01:21:39] diegoviola: do I want to use regex to add the dashes to that datetime string or is there a better way?
[01:22:10] fox_mulder_cp: hi, people. i know, some from us uses glasses becouse have a bags with eyes. i need tech specs for press release
[01:22:41] choke_: has joined #RubyOnRails
[01:24:43] a1fa: got it figured out
[01:24:51] a1fa: crazy crazy crazy LOL
[01:25:25] TDJACR: has joined #RubyOnRails
[01:25:42] smathy: ACTION just reads all that as "thanks choke"
[01:26:25] a1fa: smathy: i worked it backwards, based on the route
[01:26:35] a1fa: it looks like this route is mapped to :create
[01:26:53] a1fa: and it was redirecting to :create
[01:27:05] a1fa: but.. i got more problems now :P
[01:27:40] pwnd_nsfw: 99 problems, but that route ain't one
[01:28:01] choke: has joined #RubyOnRails
[01:28:04] a1fa: is it possible to have "helper" models? for certain actions, i need to enforce different validates_presence_of
[01:28:27] Coldblackice: has joined #RubyOnRails
[01:28:43] pwnd_nsfw: alfa, got an example of what you mean?
[01:28:46] a1fa: can you do validates_presence_of on: :whatever_action
[01:28:50] pwnd_nsfw: for enforcing different validations
[01:29:06] pwnd_nsfw: Well, the issue with that is.. controller is separate from model
[01:29:23] a1fa: and model only understads :create, :update, :destroy?
[01:29:37] pwnd_nsfw: alfa, http://stackoverflow.com/questions/6471343/validations-for-certain-actions-in-model
[01:29:44] pwnd_nsfw: a1.... that may help you
[01:30:18] smathy: ACTION hugs his Trailblazer::Operations
[01:30:30] a1fa: +1, thats how i was going to do it *answer #2
[01:30:32] pwnd_nsfw: a1fa, think of the actions as totally different. "create" in the controller is not necessarily linked to "create" in the model at all, really
[01:31:10] pwnd_nsfw: of course it'd seem silly to do something other than creating a new model in the "create" action... but you could really do whatever.
[01:31:52] a1fa: right right
[01:31:58] safety_cut: has joined #RubyOnRails
[01:33:55] shibabu: has joined #RubyOnRails
[01:40:18] _Tariq: has joined #RubyOnRails
[01:40:39] Cohedrin: has joined #RubyOnRails
[01:43:41] choke: has joined #RubyOnRails
[01:44:35] baweaver: has joined #RubyOnRails
[01:47:05] gambl0re: has joined #RubyOnRails
[01:48:27] duncannz: has joined #RubyOnRails
[01:52:14] choke: has joined #RubyOnRails
[01:54:00] hnanon: has joined #RubyOnRails
[01:54:25] hannelita: has joined #RubyOnRails
[01:54:25] Pazician: has joined #RubyOnRails
[01:54:54] hnanon: Anyone here use Middleman?
[01:55:42] Limix: has joined #RubyOnRails
[01:58:56] matthewd: hnanon: !use
[01:58:56] helpa: hnanon: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[02:00:55] pickle_: has joined #RubyOnRails
[02:03:28] baweaver: has joined #RubyOnRails
[02:03:54] johnflux: has joined #RubyOnRails
[02:03:55] johnflux: has joined #RubyOnRails
[02:07:50] diegoviola: finally got this to work
[02:08:02] diegoviola: importing my data and preventing duplicates
[02:08:06] The_Phoenix: has joined #RubyOnRails
[02:08:15] diegoviola: thanks y'all
[02:08:49] diegoviola: now I found that vim is hanging for me :(
[02:08:55] diegoviola: while indenting my code with =G
[02:09:04] diegoviola: it's the syntax highlighting, I disabled it and now it doesn't hang anymore
[02:09:24] choke: has joined #RubyOnRails
[02:10:10] pawnbox: has joined #RubyOnRails
[02:12:37] krz: has joined #RubyOnRails
[02:14:21] choke: has joined #RubyOnRails
[02:14:51] diegoviola: just added https://github.com/vim-ruby/vim-ruby/ to my ~/src/vim/bundle/ and now it doesn't hang anymore, interesting
[02:19:05] Nilbus: has joined #RubyOnRails
[02:19:24] one_zero: has joined #RubyOnRails
[02:20:40] fox_mulder_cp: diegoviola: a)activate b) restart?
[02:20:55] fox_mulder_cp: i don't know vim ((
[02:22:00] diegoviola: I had to kill vim and restart it a few times
[02:22:03] diegoviola: because of that today
[02:24:31] hannelita: has joined #RubyOnRails
[02:25:44] choke: has joined #RubyOnRails
[02:26:12] _Tariq: has joined #RubyOnRails
[02:28:32] nettoweb: has joined #RubyOnRails
[02:31:36] diegoviola: https://gist.github.com/diegoviola/4212da867e339ffb7134
[02:31:41] diegoviola: how can I break this code in 80 columns
[02:32:59] Grundell: has joined #RubyOnRails
[02:34:02] Nilbus: good example of why I don't use that indentation style. I sec???
[02:34:05] sevenseacat: has joined #RubyOnRails
[02:35:13] diegoviola: nilbus: what indentation style?
[02:35:18] matthewd: diegoviola: Wrap it before or after (depending on preferred style) the `.` before `first_or_create`
[02:35:34] pwnd_nsfw: has joined #RubyOnRails
[02:35:55] diegoviola: matthewd: you mean the . on a new line?
[02:35:58] shibabu: has joined #RubyOnRails
[02:36:07] Nilbus: diegoviola: https://gist.github.com/nilbus/c153c09e2c7d72d0ca07
[02:36:33] paradisaeidae: has joined #RubyOnRails
[02:37:21] Nilbus: See also the style guide recommendation: https://github.com/bbatsov/ruby-style-guide#indent-conditional-assignment
[02:37:41] Nilbus: whoops, wrong section. This: https://github.com/bbatsov/ruby-style-guide#no-double-indent
[02:38:16] gambl0re: has joined #RubyOnRails
[02:39:41] voker57: has joined #RubyOnRails
[02:39:41] voker57: has joined #RubyOnRails
[02:40:12] eljimmy: has joined #RubyOnRails
[02:40:45] choke: has joined #RubyOnRails
[02:41:22] LambdaSource: has joined #RubyOnRails
[02:41:23] leeky: has joined #RubyOnRails
[02:45:46] LambdaSource: has joined #RubyOnRails
[02:46:36] _Tariq: has joined #RubyOnRails
[02:47:27] StevenXL: has joined #RubyOnRails
[02:47:47] graft: has joined #RubyOnRails
[02:47:47] graft: has joined #RubyOnRails
[02:48:03] graft: hey all, what's the deal with not being able to ctrl-z in rails console without seriously mucking up my terminal?
[02:48:21] choke: has joined #RubyOnRails
[02:50:02] sevenseacat: graft: thats pretty much an unanswerable question in its current form
[02:51:02] graft: sevenseacat: sorry, i assumed this was a common experience and someone knew about it
[02:51:04] dcope: hey all, if im trying to get records that have at least one relationship (it's a to many), i thought i could just do an inner join. it seems to return records * relationships.
[02:51:09] sevenseacat: graft: its not.
[02:51:45] graft: sevenseacat: well, the issue is when i start a rails console and hit ctrl-z, it doesn't put it in the background, it is in some strange fugue state where it is half-suspended and half-not
[02:52:24] sevenseacat: got something we can see as evidence?
[02:52:32] sevenseacat: just tested it and it worked fine here
[02:52:33] graft: like what?
[02:53:15] LambdaSource: has joined #RubyOnRails
[02:53:23] sevenseacat: i dunno, a copy and paste of what you're seeing?
[02:53:39] sevenseacat: i dont know what a 'strange fugue state' is
[02:53:41] nerium: I???m trying to start my rails 5 app using ActionCable but I???m getting this error
[02:53:41] nerium: https://gist.github.com/oleander/cbc84e153a01d3228903
[02:56:30] graft: https://gist.github.com/graft/ae9777b4e225c426a5e3
[02:57:22] Grundell: has joined #RubyOnRails
[02:57:42] sevenseacat: ah hmm... using bash
[02:58:15] graft: you think this works in zsh or something?
[02:58:20] sevenseacat: I'm not sure, sorry - I can't replicate it here
[02:58:24] sevenseacat: it works here in bash and in zsh
[03:04:08] Skelz0r_: has joined #RubyOnRails
[03:05:19] Wingar_: has joined #RubyOnRails
[03:05:51] choke: has joined #RubyOnRails
[03:09:13] gbailey-: has joined #RubyOnRails
[03:09:16] aaronseibert_: has joined #RubyOnRails
[03:09:20] MarqueI: has joined #RubyOnRails
[03:11:55] Marquel: has joined #RubyOnRails
[03:12:33] Rodya_: has joined #RubyOnRails
[03:13:45] atumzin: has joined #RubyOnRails
[03:14:41] crdpink2: has joined #RubyOnRails
[03:14:53] sonOfRa: has joined #RubyOnRails
[03:16:48] choke: has joined #RubyOnRails
[03:18:25] Bloomer: has joined #RubyOnRails
[03:19:30] joshkovach: has joined #RubyOnRails
[03:22:12] tbuehlmann: has joined #RubyOnRails
[03:22:12] mlitwiniuk: has joined #RubyOnRails
[03:22:12] shaman42: has joined #RubyOnRails
[03:22:12] artX000: has joined #RubyOnRails
[03:22:12] RTG`: has joined #RubyOnRails
[03:22:12] manfrin: has joined #RubyOnRails
[03:22:13] smathy: has joined #RubyOnRails
[03:22:13] seaworthy: has joined #RubyOnRails
[03:22:13] thorgi: has joined #RubyOnRails
[03:22:13] tparenti: has joined #RubyOnRails
[03:22:13] Puffball: has joined #RubyOnRails
[03:22:13] jcm: has joined #RubyOnRails
[03:22:13] drupald: has joined #RubyOnRails
[03:22:13] machuga: has joined #RubyOnRails
[03:22:13] eisi: has joined #RubyOnRails
[03:22:13] AnoHito: has joined #RubyOnRails
[03:22:13] sunya7a__: has joined #RubyOnRails
[03:22:13] _fortis: has joined #RubyOnRails
[03:22:13] gavit: has joined #RubyOnRails
[03:22:13] sandroandrade: has joined #RubyOnRails
[03:22:13] mc_fail_: has joined #RubyOnRails
[03:22:13] chridal: has joined #RubyOnRails
[03:22:13] tw1sted: has joined #RubyOnRails
[03:22:13] pragmatism: has joined #RubyOnRails
[03:22:13] jto: has joined #RubyOnRails
[03:22:13] Janno: has joined #RubyOnRails
[03:22:13] cfloare: has joined #RubyOnRails
[03:22:13] hypnosb: has joined #RubyOnRails
[03:22:20] avelldiroll: has joined #RubyOnRails
[03:22:20] tbuehlmann: has joined #RubyOnRails
[03:22:22] mrtomme: has joined #RubyOnRails
[03:23:10] stannard: has joined #RubyOnRails
[03:23:21] juddey: has joined #RubyOnRails
[03:23:28] astickcalledlog: has joined #RubyOnRails
[03:23:36] stannard: has joined #RubyOnRails
[03:24:52] ikuis: has joined #RubyOnRails
[03:24:58] cschneid: has joined #RubyOnRails
[03:25:19] LambdaSource: has joined #RubyOnRails
[03:25:53] d0nn1e: has joined #RubyOnRails
[03:26:30] zemmihates: has joined #RubyOnRails
[03:26:31] gmci: has joined #RubyOnRails
[03:26:32] ELCALOR: has joined #RubyOnRails
[03:26:38] joaomdmoura__: has joined #RubyOnRails
[03:29:20] nerium: Is there a way list scopes / includes on a AR::Relation object?
[03:29:47] nerium: Like: users = User.active; users.scopes # => [:active]
[03:30:18] nerium: or users = User.includes(:comments); users.includes # => [:comments]
[03:30:50] matthewd: nerium: `active` is just a method, so... .methods ?
[03:31:13] nerium: matthewd: I mean scopes you???ve applies to a relation, not existing ones
[03:31:22] choke: has joined #RubyOnRails
[03:31:59] matthewd: nerium: Ah, then no, because active is just a method -- you can see the effects that it's applied, but not that they were in a scope
[03:32:24] nerium: matthewd: Aha, so scopes are applied directly
[03:32:41] nerium: Makes sense. How about #includes and #preload ?
[03:32:48] nerium: COuld those be listed?
[03:33:30] matthewd: They're not part of the documented API (so could change without deprecation), but see #includes_values / #preload_values
[03:33:42] nerium: matthewd: Nice!
[03:34:59] nerium: matthewd: I???m looking for a way to serialize a relation (for later runs).
[03:34:59] nerium: Would it be enough to just store the query, model and includes/preload values or are anything else needed?
[03:36:35] matthewd: What about all the other methods, like #where?
[03:36:55] nerium: matthewd: to_sql should be enough I guess
[03:36:55] Grundell: has joined #RubyOnRails
[03:37:59] Bloomer: has joined #RubyOnRails
[03:38:36] snguyen: has joined #RubyOnRails
[03:39:05] nerium: matthewd: Like this https://gist.github.com/oleander/e5e986a88b112dc4857f
[03:39:18] snguyen: has joined #RubyOnRails
[03:41:16] daande: has joined #RubyOnRails
[03:41:43] nerium: matthewd: I???m just trying to figure out what might explode
[03:41:51] matthewd: All the things.
[03:42:27] nerium: matthewd: How do you man?
[03:42:50] matthewd: When I said I was pretty sure you wouldn't be able to reliably serialize a relation, I wasn't kidding
[03:43:06] makenoise: has joined #RubyOnRails
[03:43:24] nerium: matthewd: Could you give me a failing example so I could eather give up of fix it?
[03:43:48] makenoise: has left #RubyOnRails: ()
[03:44:13] matthewd: Without trying it, I don't know which will / won't work, but I'd be trying: group, eager_load, includes+references
[03:44:50] nerium: matthewd: Running to_sql and passing it to find_by_sql will wont cause any problems related to that
[03:45:09] matthewd: (ignoring the fact that includes/preloads don't work with find_by_sql, so you'll have to get creative to fake them out anyway)
[03:45:20] choke: has joined #RubyOnRails
[03:45:48] nerium: matthewd: I???m not sure I???m following. Would my example solve that?
[03:45:52] yashinbasement: hi how do I make a link that request itself with different params
[03:46:45] matthewd: nerium: No.
[03:46:56] Jasaka: has joined #RubyOnRails
[03:47:12] nerium: matthewd: WHy?
[03:47:14] matthewd: nerium: I think at this point, my main question is: is this destined for an internal library, or a published gem?
[03:47:28] nerium: matthewd: Internal
[03:47:43] nettoweb: has joined #RubyOnRails
[03:48:37] matthewd: Okay, that distresses me less, at least.
[03:49:02] matthewd: Why --> the fact that includes/preloads don't work with find_by_sql
[03:50:05] nerium: yashinbasement: Rails doesn???t (as far I found a while back) any build in solution. I ended up solving it like this https://gist.github.com/oleander/c94446afc271eb6c00e9
[03:51:13] nerium: matthewd: So could you give me an edge case that breaks my solution?
[03:51:32] matthewd: > group, eager_load, includes+references
[03:51:49] nerium: matthewd: Group would be included in to_sql
[03:51:58] matthewd: (and as your solution is currently written, *anything that uses includes/preloads*)
[03:52:29] nerium: matthewd: True. includes+references will result in an INNER JOIN
[03:52:42] sevenseacat: i have an immense sense of deja vu
[03:53:15] matthewd: sevenseacat: I'm just glad we're not talking about marshalling this time
[03:54:02] matthewd: nerium: Relations have a bunch of different behaviours when grouping is applied
[03:54:23] matthewd: (and as I said, I haven't tried each.. those are just the things that come to mind that seem likely to trip it up)
[03:54:40] nerium: matthewd: So why be smart? Why not replicate all calls to the relation again?
[03:55:02] nerium: matthewd: If the user called ???references??? with :a, and ???includes??? with :a, do it again
[03:55:08] Pazician: has joined #RubyOnRails
[03:55:17] bulldawgden: has joined #RubyOnRails
[03:55:21] nerium: That would replicate the same behaviour, or I???m I wrong?
[03:56:12] matthewd: You can't reconstruct that information
[03:57:43] matthewd: I am confident there is no way to do the thing you want to do -- I'm not sure how I can be clearer on that
[03:57:44] nerium: matthewd: Would you explain why or maybe give me a failing example?
[03:58:46] matthewd: No, I'm not going to come up with counter-examples for every solution you throw out
[03:59:56] nerium: matthewd: You havent really come up with any example so far. You???ve just said that ???it wont work???. Not really an argument nor an example
[04:00:00] choke: has joined #RubyOnRails
[04:00:33] matthewd: nerium: I'm not trying to make an argument, I'm trying to give you advice
[04:02:07] matthewd: nerium: Besides, it may not matter whether I can come up with a relation that breaks: the only ones that matter are the ones your code uses
[04:02:45] nerium: matthewd: Mine are really complex. The biggest (query) contains about 2 pages of SQL
[04:03:00] nerium: It will probl. include all kinds of edge cases
[04:03:08] sevenseacat: ACTION munching on popcorn while watching tennis and this chat
[04:04:11] baweaver: has joined #RubyOnRails
[04:09:56] matthewd: nerium: Okay, how about this: start with something simple... `User.includes(:company).where(companies: { name: 'ACME' })`
[04:10:25] nerium: matthewd: I???m way a head of you :)
[04:10:41] nerium: I*ve somehting that sort of works, hold on
[04:11:22] matthewd: nerium: If you can come up with something that saves & restores that (in actual demonstrated form, not a theory), across processes, with a result that works the same for `.count` and `.first.company` (i.e., no additional query), I'll come up with a new thing that breaks it
[04:11:46] nerium: .count isn???t lazy, nor is first
[04:11:46] choke: has joined #RubyOnRails
[04:12:07] nerium: matthewd: Challange accepted!
[04:12:17] DonOtreply: has joined #RubyOnRails
[04:12:18] nerium: or is it challenge
[04:12:20] matthewd: Yeah, I just mean `.company` doesn't do an extra query -- the include does its job
[04:12:28] nerium: matthewd: Exactly
[04:15:00] uris: has joined #RubyOnRails
[04:18:09] DLSteve: has joined #RubyOnRails
[04:18:48] apeiros: I've only skimmed the conversation, so there's tons I might have gotten wrong - but assuming all you want to do is basically replay a couple of method calls with serializable params across processes, and putting a method in front is allowed, that'd be doable.
[04:19:18] Rodya_: has joined #RubyOnRails
[04:20:15] apeiros: e.g. `recorded = User.record.includes(:company).where(companies: {name: 'ACME'})`, then use something like `recorded.run` and `Marshal.dump(recorded)` (the latter to send it over to another process)
[04:20:50] apeiros: all you'd do is store the method chain and its arguments in a proxy object created by .record
[04:21:24] apeiros: but as said - maybe I completely misunderstood what you're trying to do, or missed some limitations.
[04:21:28] matthewd: apeiros: Yeah, that's probably the closest you'd be able to get
[04:22:11] matthewd: But, as well as requiring the initial call, you still miss out on unserializable parameters
[04:22:30] aloneintheworld: So??? any user can create one and only one event??? I don???t want anyone to access new or create actions if already have one event.. where should I put that restriction? On the Event Model or the Event Controller ?
[04:22:37] apeiros: unserializable params would include anything which gets a block passed.
[04:22:45] matthewd: .. like other Relations :) ... though I guess you can just rinse & repeat
[04:23:12] apeiros: hence my comment regarding the limitations.
[04:23:41] baweaver: has joined #RubyOnRails
[04:24:07] arup_r: has joined #RubyOnRails
[04:25:12] hannelita: has joined #RubyOnRails
[04:25:17] choke: has joined #RubyOnRails
[04:26:22] Rodya_: has joined #RubyOnRails
[04:27:16] nerium: apeiros: I was hoping to avoid passing the whole object to Marshal
[04:27:43] apeiros: nerium: how do you want to exchange information across processes then?
[04:28:08] matthewd: nerium: I have to go for now, so if you get a solution for that one, try: `User.where(company_id: Company.where(name: 'ACME')).group(:id)`. No include, so `.first.company` will do an extra query... but note the grouped output from `.count`.
[04:28:11] nerium: apeiros: I would just pass what needed to run the query again
[04:28:28] apeiros: note that "the whole object" in the above is just an array of method names and arguments
[04:28:35] nerium: matthewd: That already works
[04:28:46] nerium: matthewd: Unless Im missing something
[04:28:47] apeiros: nerium: um, so precisely what I suggested?
[04:29:19] nerium: apeiros: I meant the the AR::Relation object
[04:29:26] matthewd: nerium: Using what approach?
[04:29:44] apeiros: ah, I see, that example includes a relation.
[04:30:15] apeiros: eh, I'd actually have an idea
[04:30:18] apeiros: slightly crazy
[04:30:39] nerium: matthewd: I???ll try it in a bit
[04:30:46] apeiros: record { User.where(company_id: Company.where(name: 'ACME')).group(:id) }, run the block in a BasicObject and record everything, including constant lookup :)
[04:31:15] nerium: apeiros: What does record do?
[04:31:17] apeiros: still has stuff which wouldn't work, though
[04:31:35] apeiros: nerium: create a proxy object which records all constant lookups and method calls.
[04:31:46] nerium: apeiros: Aha, that was new
[04:31:56] nerium: apeiros: Why not just pass it to Marash.dump then?
[04:32:06] nerium: I gues that would generate static data
[04:32:08] apeiros: because you can't dump procs
[04:32:32] nerium: apeiros: Can AR::Relation include procs?
[04:32:35] eljimmy: has joined #RubyOnRails
[04:32:45] matthewd: nerium: If you get something working for those two, I'll probably need to see your implementation to find the next thing it's likely to trip on
[04:33:00] nerium: matthewd: Sure
[04:33:13] diegoviola: should I use Time.zone.now or Time.now?
[04:33:15] diegoviola: what is the difference?
[04:33:49] apeiros: diegoviola: Time.zone.now. the latter will cause issues with wrong times in your db.
[04:34:16] apeiros: or at least it does with oracle.
[04:34:33] apeiros: (never checked whether it happened at the driver or at AR level)
[04:34:58] eljimmy: has joined #RubyOnRails
[04:35:04] nerium: matthewd: I???m not sure I see the problem with it. Why not call to_sql on it and pass it to find_by_sql?
[04:35:30] matthewd: Time.now uses the system TZ of the machine running the ruby process, rather than the configured app TZ
[04:35:45] nerium: matthewd: A sec
[04:35:47] matthewd: Time.current is the recommended alias, which uses the right TZ
[04:36:03] nerium: matthewd: https://gist.github.com/oleander/9a8354023cf7bab5cee4
[04:36:26] matthewd: nerium: On the second one? The group.
[04:36:34] matthewd: (specifically, as combined with the count)
[04:36:46] diegoviola: Time.zone.now.day and Time.zone.now.hour is also ok?
[04:37:09] nerium: matthewd: Same thing, not sure why that would be a problem
[04:37:10] pawnbox: has joined #RubyOnRails
[04:37:25] Sawbones: has joined #RubyOnRails
[04:38:17] matthewd: nerium: Then add a .group(:id) to `questions`, and a `.count` on the find_by_sql, and compare that to `questions.count`.
[04:38:22] jklass: has joined #RubyOnRails
[04:38:23] shibabu: has joined #RubyOnRails
[04:38:53] nerium: matthewd: #count isn???t lazy for what i know
[04:39:11] nerium: or do you mean afterwards
[04:39:19] matthewd: Yes, afterwards
[04:39:59] matthewd: nerium: Also, those two queries aren't designed to be individually impossible... my intention is that a solution that works for one is unlikely to work for the other.
[04:40:28] nerium: matthewd: find_by_sql always returns an array
[04:41:06] matthewd: nerium: That sounds like a problem, then ;)
[04:42:08] matthewd: But even if you don't care about breaking/changing .count... we already agreed that find_by_sql isn't going to work for the first query (which uses a join for its includes)
[04:43:15] apeiros: matthewd: "Time.now uses ??? system TZ ??? rather than ??? app TZ" - should have been the same in our case, still caused different times in the db
[04:43:21] maximumgeek: has joined #RubyOnRails
[04:44:07] nerium: matthewd: Yes and no. The data should already be generated when it leaves the method. So the only thing you would expect is an array. .count can never be called in the background as it isn???t lazy
[04:44:08] uris: has joined #RubyOnRails
[04:44:28] nerium: Same with first
[04:44:46] nerium: So AR:Relation in Array out, nothing else
[04:45:17] choke: has joined #RubyOnRails
[04:45:49] matthewd: nerium: I'm not sure where laziness enters into it
[04:45:49] dnewkerk: has joined #RubyOnRails
[04:45:50] nerium: matthewd: Could you give me a failing example using what you had before? The user model
[04:46:25] matthewd: nerium: But if you're saying your background process will never call .count... okay.
[04:46:59] nerium: matthewd: It will only call .to_a on the object
[04:47:02] matthewd: nerium: Huh? I gave you two examples. Do you have something that works with both of them?
[04:47:19] nerium: matthewd: I only saw one, could you post the other one again?
[04:47:59] matthewd: > nerium: Okay, how about this: start with something simple... `User.includes(:company).where(companies: { name: 'ACME' })`
[04:48:19] nerium: matthewd: Thanks!
[04:49:05] matthewd: nerium: With the constraint that the includes has to take effect -- it can't N+1 when calling .company on the results
[04:49:10] nerium: matthewd: YOu also ned references I guess?
[04:49:23] nerium: matthewd: YEs, that would be a fail
[04:49:40] matthewd: Explicit references is only needed when it's hidden in an SQL fragment; with hash form it's worked out automatically.
[04:49:55] nerium: matthewd: Aha, okay
[04:50:06] nerium: matthewd: That???s something you could of posted 2h ago :p
[04:50:18] nerium: A failing example that you think would not work
[04:51:47] matthewd: It was an hour ago... and it's a specific instance of includes+references, which I suggested even earlier
[04:52:34] nerium: matthewd: Feels like 2, but okay
[04:53:01] krz: has joined #RubyOnRails
[04:56:28] markh: has joined #RubyOnRails
[04:57:42] choke: has joined #RubyOnRails
[04:58:12] Mia: has joined #RubyOnRails
[04:58:13] Mia: has joined #RubyOnRails
[05:00:52] Deft: has joined #RubyOnRails
[05:02:11] Rodya_: has joined #RubyOnRails
[05:04:59] brycesenz: has joined #RubyOnRails
[05:11:14] jscheel: has joined #RubyOnRails
[05:11:40] jscheel: has joined #RubyOnRails
[05:11:51] GriffinHeart: has joined #RubyOnRails
[05:11:56] choke: has joined #RubyOnRails
[05:12:26] uris: has joined #RubyOnRails
[05:12:45] The_Phoenix: has joined #RubyOnRails
[05:12:51] dogic: has joined #RubyOnRails
[05:13:22] dogic: i can't update a column through rails activerecord
[05:13:36] dogic: i've tried enterprise.update_attributes(@params.permit...
[05:13:44] dogic: enterprise.show_logo_in_header = false
[05:14:00] dogic: and the generate query never includes that column
[05:18:02] choke_: has joined #RubyOnRails
[05:19:07] GriffinHeart: has joined #RubyOnRails
[05:20:19] aloneintheworld: User has event_id (they can have only one event). If I delete a user???s event, how do I make sure that event_id is also deleted from User model?
[05:21:08] pipework: aloneintheworld: user.destroy_event
[05:21:41] choke: has joined #RubyOnRails
[05:22:47] gambl0re: has joined #RubyOnRails
[05:23:05] aloneintheworld: I should call user.destroy_event on the destroy method in Event then
[05:23:17] aloneintheworld: in the event controller
[05:23:41] speaking1ode: has joined #RubyOnRails
[05:24:02] aloneintheworld: but it won???t allow me to destroy it because the event is defined
[05:24:07] pickle_: has joined #RubyOnRails
[05:24:08] aloneintheworld: event_id is defined
[05:24:09] pipework: aloneintheworld: Oh no.
[05:24:12] pipework: aloneintheworld: !code
[05:24:12] helpa: aloneintheworld: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[05:25:18] aloneintheworld: not sure what code to show..
[05:26:06] pipework: aloneintheworld: not sure what code to answer with
[05:26:18] hannelita: has joined #RubyOnRails
[05:26:41] aloneintheworld: @event.destroy is all the code I have
[05:26:58] aloneintheworld: and a @user instance with an event_id value
[05:27:11] aloneintheworld: if I delete event, it throws a InvalidForeignKey error
[05:27:17] aloneintheworld: because the user still is referencing to that event
[05:27:24] choke: has joined #RubyOnRails
[05:27:25] pipework: aloneintheworld: @user.destroy_event
[05:27:47] pipework: Should do both, I believe. Otherwise you need to #reload the object.
[05:28:16] aloneintheworld: on a before_destroy callback I guess
[05:28:27] pipework: aloneintheworld: Nah.
[05:28:35] pipework: If you have @user, just call @user.destroy_event
[05:28:38] aloneintheworld: before_destroy Event, @user.destroy_event
[05:28:42] pipework: That's all you'd need to do.
[05:29:32] pipework: Are you trying to do that for the association's {after,before}_destroy callback?
[05:29:51] pipework: That might just be setting the event_id to nil on @user in the callback via #update
[05:30:15] pipework: @user.update(event_id: nil)
[05:31:40] aloneintheworld: I think I???ll do it after @event.destroy in the destroy method on the event controller
[05:31:56] aloneintheworld: @event.destroy ; current_user.destroy_event
[05:32:03] dogic: here's my code:
[05:32:05] pipework: @aloneintheworld: Don't call it twice.
[05:32:06] dogic: a = BB::Models::Enterprise.find(23)
[05:32:06] dogic: puts '******'
[05:32:06] dogic: puts a.logo_header
[05:32:06] dogic: a.update_attribute(:logo_header, true)
[05:32:12] dogic: and here's the generated query:
[05:32:19] pipework: dogic: !gist
[05:32:19] helpa: dogic: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[05:32:35] pipework: @aloneintheworld: the destroy method should be `current_user.destroy_event`
[05:32:45] pipework: Respond with the return value of that if you want.
[05:33:17] aloneintheworld: either that, or just set @event.destroy ; current_user.event_id = nil
[05:33:25] aloneintheworld: current_user.save!
[05:34:12] choke: has joined #RubyOnRails
[05:35:14] lemur: has joined #RubyOnRails
[05:35:56] dogic: pipework: https://gist.github.com/anonymous/0470531b2d45121fd39a
[05:37:06] nerium: has joined #RubyOnRails
[05:37:12] dogic: and in the logs, logo_header is false
[05:37:33] dogic: so i have no idea why active record is not generating an update clause
[05:38:42] dogic: interestingly if i use rails console it works fine
[05:40:19] shibabu: has joined #RubyOnRails
[05:42:29] erich: has joined #RubyOnRails
[05:46:47] pawnbox: has joined #RubyOnRails
[05:46:52] cmolenda: has joined #RubyOnRails
[05:47:17] cmolenda: has joined #RubyOnRails
[05:50:43] Scripore: has joined #RubyOnRails
[05:53:43] jgpawletko: has joined #RubyOnRails
[05:55:53] Pazician: has joined #RubyOnRails
[05:58:52] pipework: aloneintheworld: No. Just do one.
[05:59:00] pipework: The one I told you.
[05:59:55] choke: has joined #RubyOnRails
[06:00:45] NoTroutAboutIt: has joined #RubyOnRails
[06:02:03] Rodya_: has joined #RubyOnRails
[06:06:42] aloneintheworld: destroy_event is undefined
[06:06:51] aloneintheworld: is a custom method i should define?
[06:08:38] pipework: It might be current_user.event.destroy maybe.
[06:08:46] pipework: sorry, it's friday night.
[06:10:05] choke_: has joined #RubyOnRails
[06:12:31] hfp_work: has joined #RubyOnRails
[06:13:01] hfp: has joined #RubyOnRails
[06:16:19] Axy: has joined #RubyOnRails
[06:16:19] Axy: has joined #RubyOnRails
[06:19:23] Rinalds: has joined #RubyOnRails
[06:22:16] C0r3: has joined #RubyOnRails
[06:22:43] C0r3: Is there an enum type available for migrations in rails?? If not how to manage such data?
[06:24:22] n00bDev: has joined #RubyOnRails
[06:24:37] choke: has joined #RubyOnRails
[06:25:56] Mia: has joined #RubyOnRails
[06:25:56] Mia: has joined #RubyOnRails
[06:26:00] mices: how do i pass form data to the "next step" without saving it to the database
[06:26:34] srinidhi: has joined #RubyOnRails
[06:26:42] lxsameer: has joined #RubyOnRails
[06:27:11] hannelita: has joined #RubyOnRails
[06:29:53] sevenseacat: has joined #RubyOnRails
[06:30:13] markh: has joined #RubyOnRails
[06:31:32] choke: has joined #RubyOnRails
[06:31:58] dopie: has joined #RubyOnRails
[06:36:04] chipotle: has joined #RubyOnRails
[06:36:13] iateadonut: has joined #RubyOnRails
[06:39:23] LambdaSource: has joined #RubyOnRails
[06:44:39] Marquel: has joined #RubyOnRails
[06:46:52] eljimmy: has joined #RubyOnRails
[06:47:14] srinidhi: has joined #RubyOnRails
[06:49:13] dopie: has joined #RubyOnRails
[06:50:41] Emanon`: has joined #RubyOnRails
[06:51:18] choke: has joined #RubyOnRails
[06:51:40] gousuto: has joined #RubyOnRails
[06:53:36] lacuna: has joined #RubyOnRails
[06:57:16] roshanavand: has joined #RubyOnRails
[06:57:23] lacuna: has joined #RubyOnRails
[06:57:23] lacuna: has joined #RubyOnRails
[07:00:03] choke: has joined #RubyOnRails
[07:03:24] SteenJobs: has joined #RubyOnRails
[07:03:36] choke_: has joined #RubyOnRails
[07:08:10] choke: has joined #RubyOnRails
[07:12:18] The_Phoenix: has joined #RubyOnRails
[07:17:59] LambdaSource: has joined #RubyOnRails
[07:20:41] Bloomer_: has joined #RubyOnRails
[07:24:48] choke: has joined #RubyOnRails
[07:27:36] Sawbones: has joined #RubyOnRails
[07:29:01] hannelita: has joined #RubyOnRails
[07:33:21] Bloomer: has joined #RubyOnRails
[07:34:39] cmolenda: has joined #RubyOnRails
[07:34:48] choke: has joined #RubyOnRails
[07:39:25] choke: has joined #RubyOnRails
[07:40:20] chipotle: has joined #RubyOnRails
[07:41:46] aadam21: has joined #RubyOnRails
[07:41:52] shibabu: has joined #RubyOnRails
[07:42:41] Megamos: has joined #RubyOnRails
[07:42:54] choke: has joined #RubyOnRails
[07:49:49] Bloomer_: has joined #RubyOnRails
[07:56:39] Pazician: has joined #RubyOnRails
[07:58:02] sandstrom: has joined #RubyOnRails
[08:04:10] chipotle: has joined #RubyOnRails
[08:13:32] zeitue: has joined #RubyOnRails
[08:16:12] Sawbones: has joined #RubyOnRails
[08:17:29] The_Phoenix: has joined #RubyOnRails
[08:18:37] juddey: has joined #RubyOnRails
[08:21:35] robbyoconnor: has joined #RubyOnRails
[08:23:04] darutoko: has joined #RubyOnRails
[08:25:47] pawnbox: has joined #RubyOnRails
[08:28:02] Macaveli: has joined #RubyOnRails
[08:29:49] hannelita: has joined #RubyOnRails
[08:30:53] Cervajz: has joined #RubyOnRails
[08:31:50] Sawbones: has joined #RubyOnRails
[08:32:52] Cervajz_: has joined #RubyOnRails
[08:35:48] cmolenda: has joined #RubyOnRails
[08:36:56] chipotle: has joined #RubyOnRails
[08:37:01] lxsameer: has joined #RubyOnRails
[08:41:24] peeja: has joined #RubyOnRails
[08:42:41] The_Phoenix: has joined #RubyOnRails
[08:52:15] mdw: has joined #RubyOnRails
[08:53:00] pawnbox: has joined #RubyOnRails
[08:53:09] Technodrome: has joined #RubyOnRails
[08:55:15] yardenbar: has joined #RubyOnRails
[08:57:45] robbyoconnor: has joined #RubyOnRails
[08:58:48] nerium: has joined #RubyOnRails
[09:01:44] sandstrom: has joined #RubyOnRails
[09:06:45] hannelita: has joined #RubyOnRails
[09:07:34] Yomero2: has joined #RubyOnRails
[09:18:03] kp666: has joined #RubyOnRails
[09:18:18] JohnT: has joined #RubyOnRails
[09:21:41] hannelita: has joined #RubyOnRails
[09:32:24] riddled: has joined #RubyOnRails
[09:36:13] cmolenda: has joined #RubyOnRails
[09:38:40] Axsuul: has joined #RubyOnRails
[09:40:12] zpe: has joined #RubyOnRails
[09:42:59] chipotle: has joined #RubyOnRails
[09:45:07] shibabu: has joined #RubyOnRails
[09:45:44] Pupeno: has joined #RubyOnRails
[09:45:44] Pupeno: has joined #RubyOnRails
[09:48:30] Technodrome: has joined #RubyOnRails
[09:49:55] Pazician: has joined #RubyOnRails
[09:52:06] shibabu: has joined #RubyOnRails
[09:52:43] tibra: has joined #RubyOnRails
[09:57:44] tibra: has joined #RubyOnRails
[09:57:59] snguyen: has joined #RubyOnRails
[10:05:34] agoldboi: has joined #RubyOnRails
[10:05:51] cmolenda: has joined #RubyOnRails
[10:06:13] Omilun: has joined #RubyOnRails
[10:08:27] Omilun: has left #RubyOnRails: ()
[10:14:51] cornerma1: has joined #RubyOnRails
[10:16:03] arup_r: has joined #RubyOnRails
[10:22:13] hannelita: has joined #RubyOnRails
[10:22:42] cmolenda_: has joined #RubyOnRails
[10:31:55] zpe: has joined #RubyOnRails
[10:35:04] cac: has joined #RubyOnRails
[10:38:14] pawnbox: has joined #RubyOnRails
[10:38:39] pawnbox: has joined #RubyOnRails
[10:40:56] Sirithcam: has joined #RubyOnRails
[10:43:53] Coldblackice_: has joined #RubyOnRails
[10:44:46] albino_: has joined #RubyOnRails
[10:47:24] blackchalk: has joined #RubyOnRails
[10:47:33] srinidhi: has joined #RubyOnRails
[10:48:30] mrbubbles: has joined #RubyOnRails
[10:50:42] yfeldblum: has joined #RubyOnRails
[11:01:12] cac: has joined #RubyOnRails
[11:01:56] edwinvdgraaf: has joined #RubyOnRails
[11:11:45] aadam21: has joined #RubyOnRails
[11:12:59] cac: has joined #RubyOnRails
[11:18:15] wethu: has joined #RubyOnRails
[11:18:21] zpe: has joined #RubyOnRails
[11:20:59] rodfersou: has joined #RubyOnRails
[11:22:19] Megamos: has joined #RubyOnRails
[11:23:05] hannelita: has joined #RubyOnRails
[11:26:39] FooMunki: has joined #RubyOnRails
[11:27:19] Axsuul: has joined #RubyOnRails
[11:32:57] shinnya: has joined #RubyOnRails
[11:36:01] DEA7TH: has joined #RubyOnRails
[11:36:02] DEA7TH: has joined #RubyOnRails
[11:37:11] stamina: has joined #RubyOnRails
[11:47:42] edwinvdgraaf: has joined #RubyOnRails
[11:49:14] blackchalk: has joined #RubyOnRails
[11:50:22] melonstorm: has joined #RubyOnRails
[11:51:16] nettoweb: has joined #RubyOnRails
[11:57:01] edwinvdg_: has joined #RubyOnRails
[11:57:28] AzaToth: has joined #RubyOnRails
[12:00:17] sandstrom: has joined #RubyOnRails
[12:04:19] edwinvdgraaf: has joined #RubyOnRails
[12:04:44] mdw: has joined #RubyOnRails
[12:05:15] blackchalk: has left #RubyOnRails: ()
[12:05:42] tibra: has joined #RubyOnRails
[12:09:13] roshanavand: has joined #RubyOnRails
[12:13:25] Nilbus: has joined #RubyOnRails
[12:17:32] bensarz: has joined #RubyOnRails
[12:18:29] shibabu: has joined #RubyOnRails
[12:20:49] nettoweb: has joined #RubyOnRails
[12:21:37] yezhengch: has joined #RubyOnRails
[12:21:45] FooMunki: has joined #RubyOnRails
[12:22:05] srinidhi: has joined #RubyOnRails
[12:23:21] c355E3B: has joined #RubyOnRails
[12:23:52] hannelita: has joined #RubyOnRails
[12:24:52] raldu: has joined #RubyOnRails
[12:27:43] nonmadden: has joined #RubyOnRails
[12:28:34] edwinvdgraaf: has joined #RubyOnRails
[12:29:50] FooMunki: has joined #RubyOnRails
[12:30:51] edwinvdgraaf: has joined #RubyOnRails
[12:30:55] krz: has joined #RubyOnRails
[12:31:28] edwinvdgraaf: has joined #RubyOnRails
[12:32:59] edwinvdgraaf: has joined #RubyOnRails
[12:34:13] edwinvdgraaf: has joined #RubyOnRails
[12:35:03] tknz: has joined #RubyOnRails
[12:35:48] edwinvdgraaf: has joined #RubyOnRails
[12:36:17] yezhengch: has left #RubyOnRails: ()
[12:37:19] chipotle: has joined #RubyOnRails
[12:37:27] sameerynho: has joined #RubyOnRails
[12:40:16] crdpink: has joined #RubyOnRails
[12:45:10] arBmind: has joined #RubyOnRails
[12:46:24] roshanavand: has joined #RubyOnRails
[12:50:56] pyemkey: has joined #RubyOnRails
[12:56:00] edwinvdgraaf: has joined #RubyOnRails
[12:57:39] Megamos: has joined #RubyOnRails
[12:57:46] trautwein: has joined #RubyOnRails
[13:11:53] Scripore: has joined #RubyOnRails
[13:12:09] zeitue: has joined #RubyOnRails
[13:12:18] roshanav_: has joined #RubyOnRails
[13:14:15] daande: has joined #RubyOnRails
[13:14:29] johnflux: has joined #RubyOnRails
[13:19:14] bensarz: has joined #RubyOnRails
[13:22:26] Megamos: has joined #RubyOnRails
[13:23:28] rubyonrails791: has joined #RubyOnRails
[13:23:44] rubyonrails791: has left #RubyOnRails: ()
[13:24:18] arup_r: has joined #RubyOnRails
[13:24:48] achilles_: has joined #RubyOnRails
[13:25:23] shibabu: has joined #RubyOnRails
[13:25:41] praveen__: has joined #RubyOnRails
[13:25:43] hannelita: has joined #RubyOnRails
[13:28:27] stannard: has joined #RubyOnRails
[13:28:54] shapeshifter: has joined #RubyOnRails
[13:30:13] krz: has joined #RubyOnRails
[13:30:48] shapeshifter: Hi. I'm extending an existing rails app (spree) and it defines one of the routes as "resources :products, :only => [:index, :show]". The URLs look like domain.com/products/seo-optimized-i18n-slug-of-a-products Now how can I translate the "products" part of this URL?
[13:32:05] _Tariq: has joined #RubyOnRails
[13:32:35] aadam21: has joined #RubyOnRails
[13:33:27] BradenBraden: has joined #RubyOnRails
[13:33:53] graft: has joined #RubyOnRails
[13:34:11] bensarz_: has joined #RubyOnRails
[13:34:42] praveen: has joined #RubyOnRails
[13:47:06] arup_r: Shapeshifter: translate means ?
[13:48:47] pyemkey: has joined #RubyOnRails
[13:48:51] shapeshifter: arup_r: translating it to another language
[13:49:15] shapeshifter: arup_r: depending on the locale, requests for the products resource should use a translated URL component.
[13:49:42] shapeshifter: There's a route translator gem but it seems like I can't use it when overriding existing engine routes.
[13:49:52] shapeshifter: plus it seems overkill, I just want to translate this one route for now.
[13:52:44] wethu: has joined #RubyOnRails
[13:54:18] mices: has joined #RubyOnRails
[13:54:22] stannard: has joined #RubyOnRails
[13:59:52] arup_r: Shapeshifter: that is one of the gem, Spree I dislike :/ ... I can't help here. I worked 3 months in a Spree project, and I would never . promise. it is a pain on everything ...
[14:00:27] shapeshifter: arup_r: it is? I've just finished a deployment and there was a lot of stuff I had to do but I always thought it must be better than anything PHP
[14:00:42] shapeshifter: And most e-commerce solutions are PHP
[14:00:56] shapeshifter: The problem is that Spree is dead.
[14:01:09] shapeshifter: It just died in october...
[14:01:29] arup_r: Shapeshifter: may be.. u will get your answers once you will pass more time.. and I wouldn't say anything more.. What I said is my personal opinion. :)
[14:01:35] pyemkey: has joined #RubyOnRails
[14:04:39] nertzy: has joined #RubyOnRails
[14:04:43] Makorak: has joined #RubyOnRails
[14:04:44] chimche: has joined #RubyOnRails
[14:09:37] GriffinHeart: has joined #RubyOnRails
[14:10:37] roshanavand: has joined #RubyOnRails
[14:12:06] Dbugger: has joined #RubyOnRails
[14:12:10] Dbugger: Hello everyone!
[14:13:09] shibly: has joined #RubyOnRails
[14:13:11] Dbugger: I have a small problem... This works on sqlite3 "Bill.between(@beginning.beginning_of_day, @finish.end_of_day)" where @beginning and @finnish are Date object. But on a Postgresql it doesnt... How could I fix this? Is there a DB-independent solution?
[14:13:23] shibly: sevenseacat: Hi, How are you? What are you doing now?
[14:13:24] bulldawgden: has joined #RubyOnRails
[14:13:33] sevenseacat: shibly: not bad, and yourself?
[14:13:50] shibly: Fine, thanks
[14:14:59] chipotle: has joined #RubyOnRails
[14:15:28] arup_r: dbugger: Bill.where(date: @beginning.beginning_of_day..@finish.end_of_day)
[14:15:51] Dbugger: or created_at?
[14:16:39] Dbugger: I am using that field
[14:16:54] leonardoajim: has joined #RubyOnRails
[14:17:05] northfurr: has joined #RubyOnRails
[14:17:08] arup_r: whatever your column name. put it ,, that is an example
[14:17:21] arup_r: dbugger: read http://guides.rubyonrails.org/active_record_querying.html#conditions **2.3.2 Range Conditions**
[14:19:37] shibly: has left #RubyOnRails: ()
[14:20:13] Dbugger: arup_r, thanks that worked! I wonder though why "between" didnt
[14:21:24] arup_r: dbugger: there is no ActiveRecord method called `between`, I don't know how it worked in Sqlite3 as u said.
[14:22:20] Dbugger: what??? it worked...
[14:22:24] Dbugger: bizarre...
[14:22:33] northfurr: has joined #RubyOnRails
[14:23:58] chimche: has joined #RubyOnRails
[14:26:35] hannelita: has joined #RubyOnRails
[14:28:15] Jasaka|NA: has joined #RubyOnRails
[14:32:39] edwinvdgraaf: has joined #RubyOnRails
[14:35:08] superlou: has joined #RubyOnRails
[14:45:46] sdwrage: has joined #RubyOnRails
[14:46:39] smathy: has joined #RubyOnRails
[14:47:20] DEA7TH: has joined #RubyOnRails
[14:53:01] Siyo: has joined #RubyOnRails
[14:53:01] Siyo: has joined #RubyOnRails
[14:53:34] lxsameer: has joined #RubyOnRails
[14:53:34] lxsameer: has joined #RubyOnRails
[14:55:33] d0nn1e: has joined #RubyOnRails
[14:57:24] chouhoulis: has joined #RubyOnRails
[14:57:54] iateadonut: has joined #RubyOnRails
[14:58:00] gavit: is there an easier way to write this? https://gist.github.com/gavit/04714ac20d25873e509f#file-ruby-erb-L9
[14:59:35] arup_r: #@requested_date = params[:day].present? ? Date.new(params[:year].to_i : Date.today.year
[14:59:38] arup_r: gavit: ^^
[15:00:06] sevenseacat: without the syntax error
[15:00:08] arup_r: have some typo. but that is what I would write it
[15:00:28] arup_r: sevenseacat: yeah. sorry.. :(
[15:00:31] pyemkey: has joined #RubyOnRails
[15:00:49] arup_r: @requested_date = params[:day].present? ? Date.new(params[:year]).to_i : Date.today.year
[15:00:57] astickcalledlog: has joined #RubyOnRails
[15:02:03] nerium: has joined #RubyOnRails
[15:05:34] praveen: has joined #RubyOnRails
[15:08:21] roshanav_: has joined #RubyOnRails
[15:10:03] lexileo: has joined #RubyOnRails
[15:10:28] adavia: has joined #RubyOnRails
[15:10:42] gambl0re: has joined #RubyOnRails
[15:12:39] mib_mib: has joined #RubyOnRails
[15:13:51] mib_mib: hi - whats recommended for using multiple aws instances behind a loadbalancer? Do you just deploy to them all at the same time? or rolling restart? what about migrations that lock the tables?
[15:14:06] arup_r: I see @wycats in emberjs IRC, but not here.. why.. who knows :(
[15:14:19] sevenseacat: because he doesnt have anything to do with rails anymore
[15:14:43] Detch: has joined #RubyOnRails
[15:14:56] arup_r: ok... but he was a part of rails or is a .. ? :)
[15:15:08] sevenseacat: he was, years ago
[15:15:12] sevenseacat: he was part of the core team
[15:15:23] arup_r: anyway he is an excellent Rails guy though.. ok he quits.. hmm..
[15:15:28] sevenseacat: http://rubyonrails.org/core/alumni/
[15:16:23] arup_r: ^^ good link.. hmm I didn't know the fact
[15:18:50] pwnd_nsfw: has joined #RubyOnRails
[15:19:37] edwinvdgraaf: has joined #RubyOnRails
[15:19:39] shibabu: has joined #RubyOnRails
[15:20:04] zpe: has joined #RubyOnRails
[15:24:07] lexileo: has joined #RubyOnRails
[15:24:09] cassioscabral: has joined #RubyOnRails
[15:26:26] roshanavand: has joined #RubyOnRails
[15:26:35] yardenbar: has joined #RubyOnRails
[15:26:47] Ergo: has joined #RubyOnRails
[15:31:44] mrtomme: has joined #RubyOnRails
[15:33:32] nerium: has joined #RubyOnRails
[15:36:57] phantummm: has joined #RubyOnRails
[15:45:58] roshanav_: has joined #RubyOnRails
[15:48:32] StaticVoid: has joined #RubyOnRails
[15:49:07] pureofpure: has joined #RubyOnRails
[15:49:09] nullwarp: has joined #RubyOnRails
[15:49:21] pureofpure: Hello, can someone help with me this ? http://stackoverflow.com/questions/34694662/delayed-job-and-s3-upload-cant-finish-process-but-also-dont-give-any-error
[15:49:36] pureofpure: and tell me where i am wrong?
[15:52:56] roshanavand: has joined #RubyOnRails
[15:54:01] praveen: has joined #RubyOnRails
[15:54:42] pureofpure: any suggestion?
[15:55:25] Diabolik: does anyone have any idea why this error is being thrown up in rspec
[15:55:27] Diabolik: 1) i18n correct email shows for locale
[15:55:27] Diabolik: Failure/Error: visit spree.cart_path(country: 'US')
[15:55:27] Diabolik: ActionController::UrlGenerationError:
[15:55:27] Diabolik: No route matches {:action=>"index", :country=>"US", :language=>"en"} missing required keys: [:country]
[15:55:35] Diabolik: im passing in the country
[15:57:15] NoTroutAboutIt: has joined #RubyOnRails
[15:58:17] chouhoulis: has joined #RubyOnRails
[16:04:06] praveen: has joined #RubyOnRails
[16:06:31] srinidhi: has joined #RubyOnRails
[16:09:18] praveen: has joined #RubyOnRails
[16:09:43] joshuaturner: has joined #RubyOnRails
[16:11:06] sankaber: has joined #RubyOnRails
[16:13:09] praveen: has joined #RubyOnRails
[16:14:54] havenwood: Diabolik: Is it in your?: params.require()
[16:15:08] havenwood: Diabolik: err, #permit
[16:15:11] Diabolik: yes, but im passing in the country
[16:15:22] Diabolik: in the spec im passing in
[16:15:23] Diabolik: visit spree.cart_path(country: 'CH', language: 'en')
[16:19:30] f00dMonsta_: has joined #RubyOnRails
[16:20:34] zpe: has joined #RubyOnRails
[16:21:06] f00dMonsta__: has joined #RubyOnRails
[16:24:40] Grundell: has joined #RubyOnRails
[16:26:12] Pupeno: has joined #RubyOnRails
[16:27:00] Scripore: has joined #RubyOnRails
[16:27:17] chouhoulis: has joined #RubyOnRails
[16:27:30] f00dMonsta_: has joined #RubyOnRails
[16:27:30] StevenXL: has joined #RubyOnRails
[16:27:31] StevenXL: has joined #RubyOnRails
[16:27:36] nerium: has joined #RubyOnRails
[16:28:01] hannelita: has joined #RubyOnRails
[16:28:45] arup_r: has joined #RubyOnRails
[16:28:52] StevenXL: Hi everyone. I have a bit of a design question. I've been tasked with adding API functionality to an existing vanilla CRUD app.
[16:29:42] arup_r: stevenxl: wow.. nice. :)
[16:29:55] f00dMonsta: has joined #RubyOnRails
[16:30:01] StevenXL: It seems to me that I can either go one of two ways - use the respond_to within the controllers of the current application, or namespace my API endpoints. What are the factors that I need to be looking at in order to decide which is the most appropriate way to do this?
[16:30:12] brunto: has joined #RubyOnRails
[16:30:34] _Tariq: has joined #RubyOnRails
[16:31:27] arup_r: stevenxl: Namespacing will be fine..
[16:31:31] threeminutemonta: has joined #RubyOnRails
[16:31:32] stannard: has joined #RubyOnRails
[16:32:36] arup_r: but it would be good if the codebase have business code, in a separate places.. that will help not to duplicate
[16:32:57] arup_r: I mean the use of service objects..
[16:32:58] f00dMonsta_: has joined #RubyOnRails
[16:33:19] qejk: has joined #RubyOnRails
[16:33:22] matthewd: stevenxl: The commonality of the action implementations.. though if your controllers are appropriately skinny, there shouldn't be much redundancy
[16:33:46] StevenXL: thank you both
[16:34:12] StevenXL: so what I am hearing is that if the business logic is going to be substantially the same, maybe use respond_to, otherwise use the namespaced approach.
[16:34:26] StevenXL: That's what I figured too, but since I'm no expert, I thought I'd ask those who are
[16:34:54] Grundell: has joined #RubyOnRails
[16:36:03] f00dMonsta__: has joined #RubyOnRails
[16:36:33] cmolenda_: has joined #RubyOnRails
[16:37:27] aloneintheworld: has joined #RubyOnRails
[16:38:43] praveen: has joined #RubyOnRails
[16:41:27] f00dMonsta_: has joined #RubyOnRails
[16:42:18] cassioscabral: has joined #RubyOnRails
[16:43:35] n1lo: has joined #RubyOnRails
[16:43:47] lacuna: has joined #RubyOnRails
[16:43:48] lacuna: has joined #RubyOnRails
[16:44:44] Axsuul: has joined #RubyOnRails
[16:46:14] jpwspo: has joined #RubyOnRails
[16:46:44] njero: has joined #RubyOnRails
[16:51:50] nerium: has joined #RubyOnRails
[16:52:34] brendan-: has joined #RubyOnRails
[16:53:49] brendan-: has joined #RubyOnRails
[16:54:46] iateadonut: has left #RubyOnRails: ()
[16:55:03] Grundell: has joined #RubyOnRails
[16:55:52] cassioscabral: has joined #RubyOnRails
[16:58:09] jpwspo: has joined #RubyOnRails
[16:58:59] zpe: has joined #RubyOnRails
[17:00:18] brendan-: has joined #RubyOnRails
[17:02:53] njero: Hello... I'm trying to deploy ma rails app to aws cloud. It uses rpush for push notifications, redis for cache and postgres as db. Elasticache and RDS seems expensive.. So I'm thinking of deploying in different ec2 and connecting between. Do I need seperate ec2 for rpush or will that work fine with multiple ec2 as we scale up rails instances with same db on seperate ec2(which will be scaled vertically at least in the start).
[17:04:29] Deft_: has joined #RubyOnRails
[17:07:16] shibabu: has joined #RubyOnRails
[17:08:23] Makorak: has joined #RubyOnRails
[17:08:28] danoph: has joined #RubyOnRails
[17:08:44] praveen: has joined #RubyOnRails
[17:13:48] lacuna: has joined #RubyOnRails
[17:13:49] lacuna: has joined #RubyOnRails
[17:14:11] jpwspo: has joined #RubyOnRails
[17:14:37] El3ktra: has joined #RubyOnRails
[17:14:38] El3ktra: has joined #RubyOnRails
[17:15:37] edwinvdgraaf: has joined #RubyOnRails
[17:20:20] FailBit: you should try not using AWS
[17:20:23] BradenBraden: has joined #RubyOnRails
[17:20:45] njero: FailBit: due to cost..?
[17:21:31] FailBit: how big are you expecting to scale
[17:22:07] FailBit: or RPM for that matter
[17:22:54] smathy: has joined #RubyOnRails
[17:26:06] El3ktra: has joined #RubyOnRails
[17:26:07] El3ktra: has joined #RubyOnRails
[17:26:46] njero: FailBit: I don't have an exact figure.. Marketing end aims at getting around 10k signups in the start(in a week and high usage in that session with live user engagement). It provides live stream updates of the event they aim at.
[17:28:33] FailBit: oh, so you're not that financially hindered
[17:28:45] greengriminal: has joined #RubyOnRails
[17:28:58] hannelita: has joined #RubyOnRails
[17:29:00] njero: OOpss. Yes Iam.. we are just a startup :|
[17:29:23] nerium: has joined #RubyOnRails
[17:30:02] jpwspo: i missed the original question just signed in can you repeat it (re: AWS)
[17:30:29] njero: jpwspo: Yeah.. sure
[17:30:34] njero: Hello... I'm trying to deploy ma rails app to aws cloud. It uses rpush for push notifications, redis for cache and postgres as db. Elasticache and RDS seems expensive.. So I'm thinking of deploying in different ec2 and connecting between. Do I need seperate ec2 for rpush or will that work fine with multiple ec2 as we scale up rails instances with same db on seperate ec2(which will be scaled vertically at least in the start).
[17:30:53] arup_r: jpwspo: http://logs.ryanbigg.com/RubyOnRails
[17:30:56] djinni`: has joined #RubyOnRails
[17:31:13] arup_r: http://logs.ryanbigg.com/p/njero
[17:31:27] dustinm`: has joined #RubyOnRails
[17:31:28] njero: arup_r: that's awesome.. I didn't know there is facility like that
[17:33:14] arup_r: i need to learn scaling.. performace thing..
[17:33:19] njero: Can any one help how to attack this?... Should i go with separate instance for redis, postgres and rails?
[17:34:26] njero: What is heroku doing when we run 'heroku scale rpush=1'
[17:35:08] njero: got this from https://github.com/rpush/rpush/wiki/Heroku , to setup rpush in heroku..
[17:35:11] atomical: has joined #RubyOnRails
[17:36:25] cassioscabral: has joined #RubyOnRails
[17:42:09] _Tariq: has joined #RubyOnRails
[17:44:35] jpwspo: my two bits, it being a startup is go the easiest (not cheapest) route so you can focus on the app / features / optimizing customer acquisition. While your scale is 'small' (probably longer then you expect) the higher-cost routes are not much (if any) incremental money. So if you're going to host on AWS anyway that probably means planning to use elasticache/etc as you start scaling.
[17:45:29] stannard: has joined #RubyOnRails
[17:47:43] lxsameer: has joined #RubyOnRails
[17:47:43] lxsameer: has joined #RubyOnRails
[17:48:40] mrbubbles: Hoping that someone can suggest a clean way to architecture the following. I have a reading being taken every minute from a meter. I need to trigger an alarm when the reading is above x for more than n minutes. The alarm bit is straightforward - it's a state machine with callbacks so that the notifications are sent when the status changes. But for changing the status itself... I was going to have it record an
[17:48:40] mrbubbles: 'incident' every time the criteria are met, and then every minute i'd count the 'incidents' and if it is > n then I'll send a notification
[17:48:46] lacrymology: has joined #RubyOnRails
[17:49:11] mrbubbles: Does that sound like the best way? I was just going to have an int value on the alarm table but I need to store timestamps when the 'incidents' occured so that seemed like the best way
[17:49:17] njero: jpwspo: That's thought sticking me to amazon. Their rds and elasticache seems attractive for me once scale becomes the real player. But till then i need to configure an auto scaling setup for rails app
[17:50:19] rhizome: mrbubbles: are you reinventing nagios?
[17:50:26] mrbubbles: what's nagios
[17:50:33] mrbubbles: Haha ah right, no
[17:50:35] PedramT: has joined #RubyOnRails
[17:50:40] vlad_starkov: has joined #RubyOnRails
[17:50:44] mrbubbles: But that looks coool
[17:51:29] vlad_starkov: Hello Everybody! Someone, explain me please, why "bundle install" ignores $BUNDLE_PATH ?
[17:51:48] Scripore: has joined #RubyOnRails
[17:52:30] vlad_starkov: It just get value of $GEM_HOME instead of $BUNDLE_PATH. (Bundler version 1.11.2)
[17:53:21] rhizome: vlad_starkov: does gem_home override bundle_path?
[17:53:29] rhizome: or, i don't understand
[17:54:27] vlad_starkov: rhizome: Hi, you're extremely helpful, as far as I know you :-) Here is the details:
[17:55:12] vlad_starkov: $GEM_HOME=/home/app/.rvm/gems/ruby-2.3.0 and $BUNDLE_PATH=/srv/bundle
[17:57:05] vlad_starkov: I have created new rails app. Then cd into the its folder. Then typed command "bundle install". And then bundler installed all the gems from Gemfile to the /home/app/.rvm/gems/ruby-2.3.0 instead of /srv/bundle.
[17:57:21] vlad_starkov: rhizome: Is it kinda bug or something?
[17:59:11] lacuna: has joined #RubyOnRails
[17:59:12] lacuna: has joined #RubyOnRails
[17:59:43] cassioscabral: has joined #RubyOnRails
[18:01:54] zeitue: has joined #RubyOnRails
[18:02:36] mrbubbles: vlad_starkov does it work if you use bundler install --path /srv/bundle?
[18:02:55] vlad_starkov: mrbubbles: it does work properly
[18:03:33] vlad_starkov: https://github.com/rails/spring/issues/339 and a bit from here https://github.com/bundler/bundler/issues/875
[18:03:35] mrbubbles: try rm -rf .bundle
[18:03:35] mrbubbles: rm -rf vendor/bundle
[18:03:39] mrbubbles: bundle install
[18:04:00] vlad_starkov: mrbubbles already tried it
[18:05:47] vlad_starkov: mrbubbles: I understand that there are another ways to deal with it, such as: 1) Use --path argument or set variable directly in bundle config file. But I want to use more flexible and lightweight solution ??? which is ENV variables.
[18:10:02] brunto: has joined #RubyOnRails
[18:10:46] ur5us: has joined #RubyOnRails
[18:14:30] lacuna: has joined #RubyOnRails
[18:15:01] nickjj: has joined #RubyOnRails
[18:16:32] FernandoBasso: has joined #RubyOnRails
[18:17:41] atomical: has joined #RubyOnRails
[18:18:47] nogic: has joined #RubyOnRails
[18:19:56] xardion_: has joined #RubyOnRails
[18:20:07] nogic: has joined #RubyOnRails
[18:21:17] nogic: has joined #RubyOnRails
[18:22:27] nogic: has joined #RubyOnRails
[18:23:38] nogic: has joined #RubyOnRails
[18:23:44] mdw: has joined #RubyOnRails
[18:23:59] kadoppe: has joined #RubyOnRails
[18:24:00] Limix: has joined #RubyOnRails
[18:24:30] maesitos: has joined #RubyOnRails
[18:24:45] nogic: has joined #RubyOnRails
[18:25:54] jpwspo: has joined #RubyOnRails
[18:25:56] yos7ph: has joined #RubyOnRails
[18:29:07] rogue_koder: has joined #RubyOnRails
[18:29:43] hannelita: has joined #RubyOnRails
[18:30:10] arktisklada: has joined #RubyOnRails
[18:31:01] arktisklada: has joined #RubyOnRails
[18:31:29] arktisklada: has joined #RubyOnRails
[18:34:32] vlad_starkov: Here is new details. I was wrong saying that I ran "bundle install" command separately. I actually ran "rails new my_app" and it launched "bundle install" automatically. This way, "bundle install" for some reason ignores $BUNDLE_PATH variable. BUT When I run "bundle install" explicitly, everything goes fine and $BUNDLE_PATH worked.
[18:34:34] NoTroutAboutIt: has joined #RubyOnRails
[18:35:29] BradenBraden: has joined #RubyOnRails
[18:40:22] ro_stel: has joined #RubyOnRails
[18:40:54] ro_stel: has left #RubyOnRails: ()
[18:41:11] stel_ro: has joined #RubyOnRails
[18:41:58] dideler: has joined #RubyOnRails
[18:42:17] stel_ro: hello, how can i create helper function for current_user? i am using Devise gem, and i would like to do somethig like this : current_user.logged_in? or any other method
[18:42:22] dici: has joined #RubyOnRails
[18:42:37] Makorak: has joined #RubyOnRails
[18:42:58] diegoviola: has joined #RubyOnRails
[18:43:11] tbuehlmann: stel_ro, devise provides such a helper method: #user_signed_in?
[18:43:16] gambl0re: has joined #RubyOnRails
[18:44:07] stel_ro: yes i know, but if i want to create my own method? for e.x , every user can have some comments, and i want to do something like that : current_user.comments?
[18:44:09] vlad_starkov: Opened new issue https://github.com/rails/rails/issues/22991
[18:44:10] stel_ro: it is possible?
[18:44:32] tbuehlmann: stel_ro, sure, you'd just define such method in the User model class
[18:44:55] stel_ro: only that? then i can use this in the comments model?
[18:45:31] tbuehlmann: what method exactly do you need?
[18:45:53] stel_ro: i need to check if current user have comments
[18:45:59] stel_ro: with method
[18:46:03] stel_ro: like .comments?
[18:46:09] DEA7TH: I've read that some people use stubbing and mocking instead of DB records because otherwise the tests/specs get really slow - many minutes to run everything. How many tests do I need to have until it gets slow? My test DB is *not* SQLite (my code isn't DB-agnostic because I had to use lowercase(str) in a query).
[18:46:30] tbuehlmann: stel_ro, you like have an association between User and Comment, so you could do: current_user.comments.any?
[18:46:36] roshanavand: has joined #RubyOnRails
[18:47:08] stel_ro: ok maybe il try this
[18:47:31] DEA7TH: The stubbing and mocking works bad in some situations and I'm trying to determine what is the tradeoff - how much am I paying when I hit the DB.
[18:48:39] tbuehlmann: DEA7TH, just use the database until you think it's getting slow. in some cases stubbing/mocking is just appropriate, then stub/mock things
[18:49:34] DEA7TH: tbuehlmann: that's what I figured, but it'd be easier to do if I had some sort of estimate of extra milliseconds load time per DB hit
[18:50:03] roshanavand: has joined #RubyOnRails
[18:50:39] tbuehlmann: no idea, haven't measured anything
[18:50:53] northfurr: has joined #RubyOnRails
[18:53:36] dionysus69: has joined #RubyOnRails
[18:55:33] roshanavand: has joined #RubyOnRails
[18:56:04] embr: has joined #RubyOnRails
[18:57:53] edwinvdgraaf: has joined #RubyOnRails
[18:59:00] rhizome: DEA7TH: besides the point, but you couldn't use str.downcase ?
[19:07:11] gavit: does it still hold true that factories are loaded automatically in test/factories/*.rb - http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Defining_factories
[19:08:55] apotry: has joined #RubyOnRails
[19:09:45] Cohedrin: has joined #RubyOnRails
[19:13:03] DonOtreply: has joined #RubyOnRails
[19:17:07] sdwrage: has joined #RubyOnRails
[19:17:08] phantummm: has joined #RubyOnRails
[19:17:15] baweaver: has joined #RubyOnRails
[19:18:33] zpe: has joined #RubyOnRails
[19:18:39] DEA7TH: rhizome: The column is stored with case sensitivity, but then has case-sensitive uniqueness. You can store bAr, then you can't store baR.
[19:20:54] chimche: has joined #RubyOnRails
[19:21:36] chimche: has joined #RubyOnRails
[19:22:48] rhizome: so not so much lower(str) as lower(column_name)
[19:24:09] DEA7TH: where("lower(nickname) = ?", nickname.downcase) - can I rewrite this?
[19:24:21] DEA7TH: I believe lower is postgres-specific
[19:25:02] faisal_: has joined #RubyOnRails
[19:26:44] rhizome: no, it is standard SQL
[19:26:50] DEA7TH: or might have been this: self.where("CAST(#{column} AS TEXT) ILIKE ?", "%#{keyword}%") - it's already slightly broken, but without the cast, postgres errs when the column is numerical; also, ILIKE is postgres-specific
[19:27:14] PedramT: has joined #RubyOnRails
[19:27:24] rhizome: why would you do a string comparison on a numerical column?
[19:27:24] DEA7TH: postgres treats LIKE as case-sensitive compare, and SQLite - as case-insensitive
[19:27:28] ur5us: has joined #RubyOnRails
[19:27:47] northfurr: has joined #RubyOnRails
[19:28:26] DEA7TH: because then I allow my customer to search by anything - if I have a record with name: 'foo', height: 15, they can either type foo or 15.
[19:29:37] DEA7TH: then it searches all columns for their string
[19:30:31] hannelita: has joined #RubyOnRails
[19:31:36] anski: has joined #RubyOnRails
[19:33:15] barajasfab: has joined #RubyOnRails
[19:36:57] chimche: has joined #RubyOnRails
[19:37:20] Detch: has joined #RubyOnRails
[19:38:21] rhizome: i'd probably be thinking about using a real search engine at this point
[19:38:37] rhizome: not mandatory, just...indicated
[19:38:47] FailBit: ELASTICSEARCH IS MY BAE
[19:40:42] Diabolik: does anyone familiar with spree know whereabouts order numbers are generated
[19:43:10] Axsuul: has joined #RubyOnRails
[19:44:42] sdwrage: has joined #RubyOnRails
[19:48:26] srinidhi: has joined #RubyOnRails
[19:51:02] qejk: has joined #RubyOnRails
[19:51:34] Vert`: has joined #RubyOnRails
[19:52:13] Vert`: has left #RubyOnRails: ()
[19:52:23] Vert`: has joined #RubyOnRails
[19:53:01] Sawbones: has joined #RubyOnRails
[19:53:14] Vert`: has left #RubyOnRails: ()
[19:53:15] Vert`: has joined #RubyOnRails
[19:53:52] arup_r: Vert`: hi
[19:54:05] Vert`: I just did an upgrade from RoR 3 to 4, and I noticed that during asset compilation, it's no longer finding less files indicated in my manifest.
[19:54:10] Vert`: Does this sound familiar?
[19:54:24] FastJack: has joined #RubyOnRails
[19:56:41] northfurr: has joined #RubyOnRails
[19:57:14] Vert`: As in literally, it halts operation at the first less file it's supposed to parse. In this case I'm getting this error when referencing "bootstrap/bootstrap.less" - "Sprockets::FileNotFound: couldn't find file 'bootstrap/bootstrap' with type 'text/css'"
[19:57:43] chimche: has joined #RubyOnRails
[19:58:44] Sawbones: has joined #RubyOnRails
[19:59:19] northfurr: has joined #RubyOnRails
[20:01:34] smathy: has joined #RubyOnRails
[20:02:08] mdw: has joined #RubyOnRails
[20:02:17] Diabolik: Radar lmk when you're around
[20:02:22] Pazician: has joined #RubyOnRails
[20:02:46] fox_mulder_cp: Vert`: less != sass
[20:03:17] fox_mulder_cp: Vert`: use twitter-bootstrap gem
[20:03:35] Vert`: I've got other less files too, though.
[20:03:57] fox_mulder_cp: i use https://github.com/seyhunak/twitter-bootstrap-rails
[20:04:03] Vert`: And in RoR 3 I could just include them in the manifest, with the gems less and less-rails - did something change about this?
[20:04:17] fox_mulder_cp: google shows twbs/bootstrap-sass too
[20:04:49] _Tariq: has joined #RubyOnRails
[20:05:11] JohnBat26: has joined #RubyOnRails
[20:07:57] jpwspo: has joined #RubyOnRails
[20:10:10] LambdaSource: has joined #RubyOnRails
[20:11:00] _Tariq: has joined #RubyOnRails
[20:13:33] choke: has joined #RubyOnRails
[20:15:33] choke: Radar you around?
[20:15:48] FailBit: no, he's asleep
[20:15:55] jpwspo: has joined #RubyOnRails
[20:16:41] choke: well damn.. guess i'll have to wait till he or sevenseacat are around to ask my question about the book
[20:18:13] xlegoman: has joined #RubyOnRails
[20:20:55] mices: why not ask the wizard?
[20:21:31] choke: i don't know everyone that was involved with the book, so unless the "wizard" was a part of it, or read it -- it might be a confusing question
[20:21:48] Papierkorb: Does it work here too?
[20:23:48] choke: the question however: Chapter 10 around page 348. When creating a state for tickets while creating a comment, why in both the comment model and ticket model do we belongs_to :state instead of a has_one: state
[20:24:39] _Tariq: has joined #RubyOnRails
[20:25:17] Hans267: has joined #RubyOnRails
[20:31:15] hannelita: has joined #RubyOnRails
[20:32:42] _Tariq: has joined #RubyOnRails
[20:33:50] qejk: has joined #RubyOnRails
[20:33:51] choke: has joined #RubyOnRails
[20:34:42] Radar: Diabolik: Here now.
[20:34:43] Radar: choke: hi.
[20:35:08] rhizome: Vert`: did you run rake rails:upgrade?
[20:35:21] Sawbones: has joined #RubyOnRails
[20:35:54] Sawbones: has joined #RubyOnRails
[20:36:11] eljimmy: has joined #RubyOnRails
[20:36:17] DonOtreply: has joined #RubyOnRails
[20:37:05] rhizome: choke: because multiple comments can share the same state
[20:37:14] rhizome: so you put the FK on the comment
[20:38:14] DEA7TH: My seeds.rb has a constant. My tests use the seeds and the constant. Where should I define it? If I define it in seeds.rb, I get warnings about multiple redefinitions. CONSTANT ||= would be unclear because it implies it might be also defined in another file.
[20:39:20] Makorak: has joined #RubyOnRails
[20:40:03] choke: with a comment/ticket having a has_one, multiple comments/tickets can still share the same state. considering that the model is instanced to each instance of comments model could belong_to :state or has_one :state
[20:40:30] Papierkorb: DEA7TH: there must be a better place for it than seeds.rb - like, if it's specific to some model, put it in the Model class
[20:40:38] rhizome: DEA7TH: seeds and tests are separate, so it sounds like it should be somewhere in the app
[20:41:05] Radar: choke: did you need me for something?
[20:41:12] DEA7TH: Sure? It's specific to the seeds, the model doesn't otherwise need it.
[20:41:22] choke: comment = Comment.new and comment1 = Comment.new both are instances... in theory, it wouldn't matter if the comment.state/comment1.state is a belongs_to or has_one relation
[20:41:23] rhizome: ...and the tests
[20:41:38] rhizome: choke: except for the fk
[20:41:39] Papierkorb: DEA7TH: 'otherwise'? What is it? Some path to a CSV file or something?
[20:42:24] DEA7TH: Papierkorb: The seeds are for the development and test DBs. The constant is the value of a certain record in the seeds.
[20:42:31] DEA7TH: I could also get that value by querying the DB?
[20:42:37] rhizome: choke: if State has comment_id, how do you have multiple comments per state?
[20:43:35] choke: state wouldn't have comment_id... bi-directional.. comment has_one :state, state has_many :comments which is really what the FK does
[20:43:44] Papierkorb: DEA7TH: Then query it. Why does the test need to know about that thing? Are you testing if it's there?
[20:44:03] mib_mib: has joined #RubyOnRails
[20:44:08] rhizome: choke: has_many on one side and has_one on the other doesn't work.
[20:44:19] rhizome: it's belongs_to
[20:44:25] mib_mib: hi all - if i dont set 'pool' in database.yml - does it default to 5? Or does activerecord not use a connection pool?
[20:44:57] choke: Radar yeah, but rhizome is helping to wrap my head around it.
[20:45:14] choke: Alright, now I understand rhizome -- me being a moron... thanks
[20:45:26] rhizome: you're welcome!
[20:45:37] DEA7TH: Papierkorb: If the total cost is below a certain number, it gets set to it. The tests need to know which number it because one test case must be below it, and another - above it.
[20:46:21] Diabolik: it's somewhat spree specific
[20:46:42] Papierkorb: DEA7TH: Then I'd put it in the model if you don't have anything else for configuration data
[20:47:26] rhizome: DEA7TH: you could put it in a lib that is included by both
[20:47:44] rhizome: at least you get a single point of definition that way
[20:47:55] rhizome: ACTION is sure there's an official CS term for that
[20:48:16] Diabolik: its part of orthogonal design
[20:48:17] DEA7TH: ^ That sounds nice. Or I can query for it.
[20:48:22] Diabolik: i dunno what the real cs term is
[20:48:39] rhizome: it's DRY at the very least
[20:48:41] DEA7TH: "shared"?
[20:48:48] craysiii: has joined #RubyOnRails
[20:51:33] DonOtreply: has joined #RubyOnRails
[20:51:37] northfurr: has joined #RubyOnRails
[20:52:03] chrisarcand: I think this page needs plenty of updating: http://rubyonrails.org/core/ :/
[20:52:20] DEA7TH: actually it's unrelated to DRY/shared/reuse. It's (avoidance of) _namespace pollution_
[20:53:24] rhizome: there ya go
[20:53:49] alex88: has joined #RubyOnRails
[20:54:25] rhizome: maybe. i can't figure out how to get to namespace pollution when it's the same thing in completely separate contexts
[20:55:19] pontiki: chrisarcand: here's the repo: https://github.com/rails/rails.github.com - fork it, update, and make a PR
[20:57:51] moresilenter: has joined #RubyOnRails
[21:01:28] centrx: has joined #RubyOnRails
[21:02:22] brunto: has joined #RubyOnRails
[21:03:53] chrisarcand: pontiki: I don't think I'll be making a PR writing details on people I don't know personally, nor do I know who is exactly on the team at this point :) (hence my looking at the page...)
[21:04:05] BradenBraden: has joined #RubyOnRails
[21:04:50] moresilenter: looking around for something like ActiveAdmin that will work with ActiveResource (or any other library to set infront a REST API, pretty flexible there)
[21:05:02] moresilenter: anybody have any suggestions?
[21:05:47] pontiki: chrisarcand: this is a pretty way to tell (last 2 years selected): https://github.com/rails/rails/graphs/contributors?from=2014-01-03&to=2016-01-09&type=c
[21:06:41] DonOtreply: has joined #RubyOnRails
[21:07:10] northfurr: has joined #RubyOnRails
[21:07:20] pontiki: also interesting: https://github.com/rails/rails/pulse
[21:07:34] rhizome: moresilenter: http://stackoverflow.com/questions/29440371/activeresource-with-railsadmin-or-activeadmin
[21:09:13] moresilenter: ran into that one a few weeks ago! it's useful, but tons of monkey patches and doesn't play well with associations
[21:10:07] marr: has joined #RubyOnRails
[21:13:48] das3in: has joined #RubyOnRails
[21:14:22] lethjakman: has joined #RubyOnRails
[21:16:27] matthewd: chrisarcand: It's not *too* out of date... it just needs +me and -josevalim
[21:16:32] aadam21: has joined #RubyOnRails
[21:16:50] matthewd: (and that's my fault.. I've been dragging my feet)
[21:18:36] ql6wlld: has joined #RubyOnRails
[21:21:04] joshuaturner: has joined #RubyOnRails
[21:27:33] smathy: has joined #RubyOnRails
[21:28:00] jklass: has joined #RubyOnRails
[21:28:01] northfurr: has joined #RubyOnRails
[21:28:30] Sawbones: has joined #RubyOnRails
[21:29:00] stel_ro: has joined #RubyOnRails
[21:29:25] stel_ro: hey, can i use delayed_job_active_record on method that returns a hash ? or some value anyway?
[21:32:03] hannelita: has joined #RubyOnRails
[21:40:07] Makorak: has joined #RubyOnRails
[21:40:24] lele: has joined #RubyOnRails
[21:46:17] ur5us: has joined #RubyOnRails
[21:46:21] mib_mib: has joined #RubyOnRails
[21:46:51] mib_mib: Hi all - why when i put a translation in my view like t(:some_missing_string) and go to the url, it doesn't say translation missing, it just says "Some Missing String" - ?
[21:47:58] FailBit: mib_mib: http://api.rubyonrails.org/classes/ActionView/Helpers/TranslationHelper.html
[21:48:16] FailBit: * a titleized version of the last key segment as a text.
[21:48:22] FailBit: E.g. the value returned for a missing translation key :???blog.post.title??? will be <span class=???translation_missing??? title=???translation missing: en.blog.post.title???>Title</span>. This way your views will display rather reasonable strings but it will still be easy to spot missing translations.
[21:50:37] mib_mib: FailBit: i see that, but then why if i do like <%# flash[:notice] %> where i set flash[:notice] = t(:some_other_missing_string) (in controller)
[21:51:02] mib_mib: FailBit: this renders in the view as: "translation missing: en.hello_world"
[21:51:13] mib_mib: FailBit: i.e. in this case it prepends the translation missing string to it
[21:51:24] ur5us: has joined #RubyOnRails
[21:51:41] mib_mib: FailBit: isn't it odd behavior for the same translate method on the same string to render differently?
[21:52:25] mib_mib: FailBit: depending on wheter the method was called in the view or in a controller?
[21:52:50] FailBit: mib_mib: http://api.rubyonrails.org/classes/AbstractController/Translation.html
[21:52:54] FailBit: because you're looking at the wrong thing
[21:53:03] FailBit: ActionView ??? ActionController
[21:53:35] mib_mib: FailBit: but dont they both delegate to Il8n.translate method?
[21:53:43] Scripore: has joined #RubyOnRails
[21:53:48] FailBit: superficially
[21:54:05] FailBit: https://github.com/rails/rails/blob/master/actionpack/lib/abstract_controller/translation.rb
[21:54:26] FailBit: https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/translation_helper.rb
[21:54:37] mib_mib: FailBit: i guess they are both wrapping it, but this seems pretty stupid to me
[21:54:47] djbkd: has joined #RubyOnRails
[21:54:47] FailBit: why would it
[21:54:55] FailBit: ActionController should never be involved in HTML generation
[21:55:10] Pazician: has joined #RubyOnRails
[21:55:14] Sawbones: has joined #RubyOnRails
[21:55:21] mib_mib: so settinging like flash[:notice] = t(:some_message) should never happen?
[21:55:28] mib_mib: in the controller?
[21:55:28] pontiki: mib_mib: if you actully look at the html source, you'll see the view version is doing what you may think it's doing
[21:55:38] FailBit: no, that's not what I mean
[21:55:51] pontiki: sorry, is NOT doing
[21:56:13] Haydos: has joined #RubyOnRails
[21:56:29] mib_mib: FailBit: all i'm saying is that i think its 'reasonable' to expect calling @myvar = t(:some_message) to render the same as calling t(:some_message) in the view
[21:56:36] mib_mib: but it doens't
[21:56:41] pontiki: it doesn't
[21:56:41] FailBit: then only run t() in the view
[21:56:45] pontiki: look at what it does do
[21:57:02] mib_mib: yes, and i'm saying i think thats a dumb design decision
[21:57:28] mib_mib: because it has the 'appearance' of calling Il8n.translate directly
[21:57:30] mib_mib: but it doesn't
[21:57:35] mib_mib: i mean, i can call it directly, fine
[21:57:46] mib_mib: but its confusing for sure, and hidden
[21:58:07] FailBit: internationalization (18 characters between i..n)
[21:58:08] mib_mib: that one =D
[21:58:22] mib_mib: oh nice, never new that
[21:58:47] mib_mib: at least, it should be called something different
[21:58:57] mib_mib: pretty_translate
[21:58:58] mib_mib: or something
[21:59:30] mib_mib: anyway - something i would change =D
[21:59:38] mib_mib: thanks for the help though =D
[22:00:04] rhizome: and now you know where a16z comes from, too!
[22:00:33] Uranio: has joined #RubyOnRails
[22:00:33] solars: has joined #RubyOnRails
[22:00:37] steffkes: has joined #RubyOnRails
[22:00:37] steffkes: has joined #RubyOnRails
[22:00:40] mdw: has joined #RubyOnRails
[22:02:28] cac: has joined #RubyOnRails
[22:04:00] oo: has joined #RubyOnRails
[22:04:08] oo: has left #RubyOnRails: ()
[22:04:21] loren: has joined #RubyOnRails
[22:16:10] pontiki: i have no idea
[22:16:16] pontiki: a24z maybe
[22:17:26] zpe: has joined #RubyOnRails
[22:18:01] eljimmy: has joined #RubyOnRails
[22:18:51] rhizome: you have a fever
[22:21:06] pontiki: wouldn't be the first time
[22:21:15] pontiki: nor the last if i survive this one
[22:24:34] yfeldblum: has joined #RubyOnRails
[22:25:57] mdw: has joined #RubyOnRails
[22:26:00] choke_: has joined #RubyOnRails
[22:28:56] penne12: has joined #RubyOnRails
[22:31:23] Megamos: has joined #RubyOnRails
[22:32:34] das3in: https://gist.github.com/das3in/62521d0cf4fd4dc1fbd2 Getting a NoMethodError because my @user variable isn't getting set correctly. I've confirmed in the console that the user that's logged in has a role of 2. It seems to be setting to current_user so the elsif statement isn't working
[22:33:28] edwinvdgraaf: has joined #RubyOnRails
[22:33:55] fox_mulder_cp: mib_mib: what you think when say pretty_translate?
[22:34:18] _Tariq: has joined #RubyOnRails
[22:35:15] pyemkey: has joined #RubyOnRails
[22:38:03] praveen: has joined #RubyOnRails
[22:43:52] barajasfab: has joined #RubyOnRails
[22:47:30] eggie5: has joined #RubyOnRails
[22:48:17] aadam21: has joined #RubyOnRails
[22:48:53] ur5us: has joined #RubyOnRails
[22:49:17] SteenJobs: has joined #RubyOnRails
[22:50:11] Radar: Diabolik: Sure.
[22:52:46] flashpoint9: has joined #RubyOnRails
[22:54:12] rhizome: das3in: what does it mean for a role to be an integer?
[22:54:56] flashpoint9: is better_errors still the best for error pages?
[22:55:07] Radar: flashpoint9: yes
[22:55:12] sankaber: has joined #RubyOnRails
[22:55:19] Radar: !best also
[22:55:19] helpa: "Best" and "better" are subjective. Try to use a different term.
[22:56:11] Sawbones: has joined #RubyOnRails
[22:56:32] atomical: has joined #RubyOnRails
[22:57:06] flashpoint9: helpa: is better_errors an integral part in saving my soul for jesus?
[22:57:07] lethjakman: has joined #RubyOnRails
[22:58:43] choke: has joined #RubyOnRails
[23:01:22] DonOtreply: has joined #RubyOnRails
[23:02:50] wethu: has joined #RubyOnRails
[23:03:38] Sawbones: has joined #RubyOnRails
[23:04:17] DEA7TH: has joined #RubyOnRails
[23:05:42] markh: has joined #RubyOnRails
[23:07:37] cina: has joined #RubyOnRails
[23:08:38] cina: can I use ActionCable on Rails 4? I installed the 'actioncable' gem but it is almost empty (versioned 0.0.0).
[23:10:50] pawnbox: has joined #RubyOnRails
[23:12:24] choke: has joined #RubyOnRails
[23:12:52] fox_mulder_cp: cina: hm. u may gen rails5 app for some lines of Gemfile :)
[23:13:26] fox_mulder_cp: i see, that r5 beta ok for my app, which i developed with it
[23:15:12] The_Phoenix: has joined #RubyOnRails
[23:19:32] adogcalledcat: has joined #RubyOnRails
[23:19:59] Guest60: has joined #RubyOnRails
[23:25:21] lacrymology: has joined #RubyOnRails
[23:26:50] paulodiniz: has joined #RubyOnRails
[23:27:39] DonOtreply: has joined #RubyOnRails
[23:28:22] cac: has joined #RubyOnRails
[23:28:57] aloneintheworld: has anyone used Rolify? How can I have one model scoped to one specified role ?
[23:30:01] wethu: has joined #RubyOnRails
[23:32:35] Guest60: has left #RubyOnRails: ()
[23:32:38] Guest60: has joined #RubyOnRails
[23:32:49] SteenJobs: has joined #RubyOnRails
[23:32:56] Kallis: has joined #RubyOnRails
[23:33:05] Guest60: has left #RubyOnRails: ()
[23:33:07] Guest60: has joined #RubyOnRails
[23:33:24] choke: has joined #RubyOnRails
[23:38:10] pyemkey: has joined #RubyOnRails
[23:38:34] das3in: rhizome: that was exactly the problem. It's an enum and I had been working in the console so much I forgot that I had them named. Switching to current_user.admin? solved the problem
[23:40:49] Makorak: has joined #RubyOnRails
[23:40:59] pawnbox: has joined #RubyOnRails
[23:41:28] greenride: has joined #RubyOnRails
[23:42:10] greenride: Is there a line I can add to config.application.rb to skip generation of all files with the .erb extension?
[23:42:53] cina: fox_mulder_cp: Thanks! so, did you use actioncable "5.0.0.beta1" in your Rails 4 app with no issues?
[23:44:38] cina: I can't install ActionCable "5.0.0.beta1" on Rails 4 (lots of dependency errors)
[23:45:09] threeminutemonta: has joined #RubyOnRails
[23:45:22] cina: first dependency seems to be actionpack "5.0.0.beta1"
[23:50:00] aadam21: has joined #RubyOnRails
[23:51:44] Radar: cina: They're not compatible
[23:51:59] Radar: Use Rails 5 if you want Rails 5 features.
[23:52:05] SteenJobs: has joined #RubyOnRails
[23:53:23] kies^: has joined #RubyOnRails
[23:54:29] choke: has joined #RubyOnRails
[23:55:19] sandroandrade: has joined #RubyOnRails
[23:56:08] Pazician: has joined #RubyOnRails
[23:57:37] lacuna_: has joined #RubyOnRails