« Back to channel list

#RubyOnRails - 28 October 2017

« Back 1 day Forward 1 day »
[00:00:38] jrabe: has joined #RubyOnRails
[00:01:48] hahuang65: has joined #RubyOnRails
[00:11:36] lethjakman: has joined #RubyOnRails
[00:14:49] hfp_work: has joined #RubyOnRails
[00:19:24] jottr_: has joined #RubyOnRails
[00:24:27] workmad3: has joined #RubyOnRails
[00:33:28] fryguy: has joined #RubyOnRails
[00:47:54] alfiemax: has joined #RubyOnRails
[00:48:33] jottr_: has joined #RubyOnRails
[00:59:09] irishfromua: has joined #RubyOnRails
[01:08:47] Technodrome: has joined #RubyOnRails
[01:10:47] jottr: has joined #RubyOnRails
[01:12:20] lethjakman: has joined #RubyOnRails
[01:28:03] ur5us: has joined #RubyOnRails
[01:42:03] orbyt_: has joined #RubyOnRails
[01:43:36] ectos: has joined #RubyOnRails
[01:55:14] jjaii9: has joined #RubyOnRails
[01:56:59] jjaii9: does a "back-end service" *always* mean api, or could it just mean the server-side logic of a monolith (client+server in same app)?
[02:01:51] elomatreb: jjaii9: The distinction often just means "code than runs on the server" (backend) vs. "code that runs on the client" (frontend)
[02:02:33] hahuang65: has joined #RubyOnRails
[02:06:07] jjaii9: elomatreb: k was thinking that
[02:06:14] jjaii9: elomatreb: thanks u
[02:08:09] arathald: has joined #RubyOnRails
[02:11:45] ur5us: has joined #RubyOnRails
[02:12:57] mcr1: has joined #RubyOnRails
[02:13:12] lethjakman: has joined #RubyOnRails
[02:21:54] lethjakman: has joined #RubyOnRails
[02:25:05] workmad3: has joined #RubyOnRails
[02:26:58] hfp_work: has joined #RubyOnRails
[02:29:07] TViernion: anyone seen a LoadError: cannot load such file -- mimemagi when running bundle exec rake redmine:plugins:migrate RAILS_ENV=production?
[02:35:15] jottr: has joined #RubyOnRails
[02:37:41] alfiemax: has joined #RubyOnRails
[02:38:10] orbyt_: has joined #RubyOnRails
[02:45:48] orbyt_: has joined #RubyOnRails
[03:00:47] andrew9184: has joined #RubyOnRails
[03:15:17] alfiemax: has joined #RubyOnRails
[03:28:31] apparition: has joined #RubyOnRails
[03:50:29] dionysus69: has joined #RubyOnRails
[03:52:21] irishfromua: has joined #RubyOnRails
[03:55:04] irishfromua: has joined #RubyOnRails
[03:59:45] Technodrome: has joined #RubyOnRails
[04:03:23] hahuang65: has joined #RubyOnRails
[04:10:47] Saukk: has joined #RubyOnRails
[04:25:23] ahrs: has joined #RubyOnRails
[04:25:47] workmad3: has joined #RubyOnRails
[04:28:15] irishfromua: has joined #RubyOnRails
[04:36:14] xibalba: has joined #RubyOnRails
[04:36:21] jottr: has joined #RubyOnRails
[04:39:46] irishfromua: has joined #RubyOnRails
[05:20:37] jfelchner: has joined #RubyOnRails
[05:37:05] jottr: has joined #RubyOnRails
[05:45:06] s2013: has joined #RubyOnRails
[05:45:16] ectos: has joined #RubyOnRails
[05:53:33] damasta: has joined #RubyOnRails
[05:53:35] damasta: Anyone working on a programming project and need an extra set of hands?
[06:04:16] hahuang65: has joined #RubyOnRails
[06:16:58] jphase: has joined #RubyOnRails
[06:26:28] workmad3: has joined #RubyOnRails
[06:51:52] TViernion: not for ruby damasta
[06:52:10] TViernion: anyone able to help with a passenger starting ruby issue? lol
[06:53:07] s2013: has joined #RubyOnRails
[07:10:00] DTZUZO: has joined #RubyOnRails
[07:13:44] ^mtkd: has joined #RubyOnRails
[07:15:31] DoubleMalt: has joined #RubyOnRails
[07:37:54] jottr: has joined #RubyOnRails
[07:45:51] srinidhi: has joined #RubyOnRails
[07:50:37] marr: has joined #RubyOnRails
[08:03:39] snickers: has joined #RubyOnRails
[08:05:21] hahuang65: has joined #RubyOnRails
[08:07:56] alfiemax: has joined #RubyOnRails
[08:25:03] arBmind: has joined #RubyOnRails
[08:27:10] workmad3: has joined #RubyOnRails
[08:31:40] one_zero: has joined #RubyOnRails
[09:05:12] dionysus69: has joined #RubyOnRails
[09:33:58] bruno-: has joined #RubyOnRails
[09:35:36] lxsameer: has joined #RubyOnRails
[09:38:46] jottr: has joined #RubyOnRails
[09:40:13] mtkd: has joined #RubyOnRails
[09:48:51] snickers: has joined #RubyOnRails
[09:59:00] quazimodo: has joined #RubyOnRails
[10:06:10] hahuang65: has joined #RubyOnRails
[10:07:08] Fernando-Basso: has joined #RubyOnRails
[10:16:46] jottr: has joined #RubyOnRails
[10:20:08] mikecmpbll: has joined #RubyOnRails
[10:24:23] marr: has joined #RubyOnRails
[10:27:52] workmad3: has joined #RubyOnRails
[10:36:40] mostlybadfly: has joined #RubyOnRails
[10:41:43] wethu: has joined #RubyOnRails
[11:32:17] snickers: has joined #RubyOnRails
[11:37:57] ^mtkd: has joined #RubyOnRails
[12:06:40] nir0: has joined #RubyOnRails
[12:06:56] hahuang65: has joined #RubyOnRails
[12:08:38] nir0: hello guys! how do i scope with one habtm association, say, author habtm books, and now i need books with one author
[12:14:46] mtkd: has joined #RubyOnRails
[12:15:13] wethu: has joined #RubyOnRails
[12:15:22] s2013: has joined #RubyOnRails
[12:16:57] matthewd: nir0: Not particularly easily
[12:18:50] gamblor3: has joined #RubyOnRails
[12:19:43] quazimodo: has joined #RubyOnRails
[12:23:35] apparition: has joined #RubyOnRails
[12:24:19] matthewd: nir0: You can do it in SQL by left joining books to authors twice, and finding those without a second author. But off the top of my head, I can't think of a more activerecord-y way to do that than something like `Book.joins(:authors).left_joins("books_authors AS second_authorships ON (books.id = second_authorships.book_id) LEFT JOIN authors AS second_authors ON (second_authorships.author_id = second_authors.id AND second_authors.id <>
[12:24:20] matthewd: authors.id)")`
[12:26:02] nir0: thank you, matthewd
[12:26:08] nir0: i'll try that
[12:32:07] wethu: has joined #RubyOnRails
[12:34:11] psychoslave: has joined #RubyOnRails
[12:35:57] nir0: ArgumentError: only Hash, Symbol and Array are allowed
[12:37:15] Technodrome: has joined #RubyOnRails
[12:38:05] matthewd: Oh, maybe `.joins("LEFT JOIN books_authors [etc]` instead of `.left_joins("books_authors [etc]` ?
[12:41:28] nir0: yeah it returns all books
[12:43:57] nir0: 4 books, 4 authors, 7 authorships...
[12:44:11] nir0: and this query returns 15 results
[12:44:28] nir0: i expected to have 1 :)
[12:48:22] sevenseacat: has joined #RubyOnRails
[12:49:47] matthewd: Oops, sorry, I missed rather an important part :P
[12:50:07] matthewd: .where("second_authors.id IS NULL")
[12:51:34] nir0: 7 results
[12:53:48] matthewd: Book.joins(:authors).joins("LEFT JOIN books_authors AS second_authorships ON (books.id = second_authorships.book_id AND books_authors.author_id <> second_authorships.author_id)").where("second_authorships.author_id IS NULL")
[12:53:57] matthewd: (that's just a simplification, not a change of logic)
[12:55:07] matthewd: What do those 7 records look like? One per authorship? :/
[12:56:25] DoubleMalt: has joined #RubyOnRails
[12:57:11] nir0: actually this simplification worked
[12:57:17] nir0: 2 results
[12:57:55] matthewd: Weren't we expecting 1?
[12:58:15] nir0: well, it's my fault
[12:58:41] nir0: i simplified conditions in question
[12:59:14] nir0: actually i need authors who never worked with other authors :D
[12:59:29] nir0: but i think i'll manage to do this now
[12:59:45] nir0: thank you so much <3
[13:00:12] matthewd: Oh, yeah, I think that's easier
[13:03:00] matthewd: `has_many :coauthors, -> { where("authors.id <> coauthors.id") }, through: :books, source: :authors`; author.left_joins(:coauthors).where("coauthors.id IS NULL")
[13:03:07] matthewd: Or something like that?
[13:03:22] matthewd: Same basic theory
[13:03:50] nir0: i'm trying to do it without coauthors, but its interesting approach
[13:04:17] matthewd: Without what? That's just an association, not a table.
[13:07:33] nir0: it tries to access a table
[13:07:53] nir0: no such column: coauthors.id
[13:08:21] matthewd: Oh, I must've guessed the wrong name
[13:15:56] dionysus69: has joined #RubyOnRails
[14:04:46] z80lives: has joined #RubyOnRails
[14:05:51] z80lives: has left #RubyOnRails: ()
[14:08:04] hahuang65: has joined #RubyOnRails
[14:16:39] gauravgoyal: has joined #RubyOnRails
[14:17:47] chouhoulis: has joined #RubyOnRails
[14:29:12] workmad3: has joined #RubyOnRails
[14:32:14] alfiemax: has joined #RubyOnRails
[14:38:34] santi: has joined #RubyOnRails
[14:40:26] Technodrome: has joined #RubyOnRails
[14:44:37] alfiemax: has joined #RubyOnRails
[14:45:50] santi: has joined #RubyOnRails
[14:57:21] guacamole: has joined #RubyOnRails
[15:43:53] guacamole: has joined #RubyOnRails
[16:03:30] segy: has joined #RubyOnRails
[16:07:34] mtkd: has joined #RubyOnRails
[16:08:55] hahuang65: has joined #RubyOnRails
[16:20:12] orbyt_: has joined #RubyOnRails
[16:21:03] irishfromua: has joined #RubyOnRails
[16:25:03] Technodrome: has joined #RubyOnRails
[16:29:56] workmad3: has joined #RubyOnRails
[16:35:24] Fernando-Basso: has joined #RubyOnRails
[16:44:23] dviola: has joined #RubyOnRails
[17:29:52] guacamole: has joined #RubyOnRails
[17:31:00] lxsameer: has joined #RubyOnRails
[17:32:18] Technodrome: didn't know there was an oauth identity gem, interesting
[17:35:01] amritoit: has joined #RubyOnRails
[17:41:51] dionysus69: has joined #RubyOnRails
[17:50:44] orbyt_: has joined #RubyOnRails
[17:53:57] dionysus69: has joined #RubyOnRails
[18:00:32] reggaemuffin: has joined #RubyOnRails
[18:02:26] reggaemuffin: I am looking to contribute to activerecord and wanted to talk to a few people first to get a feel of how everything is structured and where a good start would be
[18:02:51] dionysus69: has joined #RubyOnRails
[18:03:15] guacamole: has joined #RubyOnRails
[18:03:56] dminuoso: reggaemuffin, be sure to have looked at this: http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html
[18:04:22] reggaemuffin: Thank you, that was what directed me here
[18:06:08] reggaemuffin: I always like to clean up or refactor code to get a feel for how it works, so if you know some of these hairy issuees that no one wants to come near, that would be a perfect start for me :)
[18:07:04] Fafner13: has joined #RubyOnRails
[18:07:36] dminuoso: reggaemuffin, my suggestion is, go to https://github.com/rails/rails/issues and start working on that.
[18:08:13] dminuoso: If you just want to contribute for the sake of contributing I mean.
[18:09:09] reggaemuffin: Well, my plan was to get in touch with how the query system works and expand my knowledge there. And when I read the code anyway, I can give back to the comunity.
[18:09:31] dminuoso: reggaemuffin, https://github.com/rails/arel
[18:09:47] hahuang65: has joined #RubyOnRails
[18:09:56] dminuoso: That's the core behind how queries are constructed.
[18:11:10] reggaemuffin: @dminuoso do you by chance know any issues there that make for a good first patch?
[18:12:23] wenj1_: has joined #RubyOnRails
[18:19:05] matthewd: There really aren't any; approachable issues tend to get resolved quickly
[18:19:39] reggaemuffin: Yeah that seems to be the case from glancing over the issue list :I
[18:20:57] reggaemuffin: I guess I'll take a look at the code first and see if I can find any work that is not an issue yet. Can I come back here and ask about things that could be useful contributions?
[18:23:08] dminuoso: matthewd, I was using ActiveRecord::Base.connection.select_XXX yesterday, but @column_types seems to be empty, which causes the underlying boolean values in sqlite to be emitted as "f" and "t"
[18:24:19] dminuoso: Any pointer for a portable method of coercing that into true/false? ActiveRecord::Type does not appear to have something immediately useful here.
[18:25:01] matthewd: reggaemuffin: Sure.. though be aware that cosmetic changes and minor refactorings are discouraged
[18:27:05] reggaemuffin: Will keep that in mind, thank you!
[18:28:08] matthewd: dminuoso: AR::Type should know how to coerce it, if you know the type you're expecting
[18:30:27] dminuoso: matthewd, but isn't this potentially adapter dependent?
[18:32:10] matthewd: Do we not have an API that runs a query, and uses the result columns' types to convert automatically? :/
[18:32:37] wenj1_: In this short GitHub Gist (https://git.io/vFIg5), is there a preferred way to reference the id? I've seen both ways
[18:34:25] Technodrome: has joined #RubyOnRails
[18:38:18] dminuoso: wenj1_, As long as you are consistent I dont see an issue with either approach.
[18:39:01] wenj1_: dminuoso: Thank you!
[18:39:03] matthewd: wenj1_: I'd favour the former
[18:39:21] wenj1_: matthewd: Interesting :)
[18:39:47] matthewd: More consistent with uses like `link_to(_, blog_item)`
[18:40:01] dminuoso: matthewd, Im guessing that it automatically uses .class.primary_key so that it also works if its not called "id" ?
[18:40:19] dminuoso: matthewd, I use explicit path helpers even for them.
[18:40:33] matthewd: dminuoso: Technically it calls to_param, which calls id, which always uses the PK
[18:40:34] dminuoso: But I dont really have a choice because my routes have grown complicated.
[18:41:33] dminuoso: matthewd, regarding your `API` comment - thats why I was asking. I found some bits and pieces how rails 3.0 used to do this, but it's a bit unclear how its done in 5.1
[18:41:33] uks: has joined #RubyOnRails
[18:41:45] dminuoso: But if you dont have a hint, Ill just debug the thing.
[18:43:59] matthewd: Yeah, don't know why the types aren't coming through there, sorry. Not even sure whether they should be, or it's a bug.
[18:49:21] matthewd: dminuoso: direct/resolve (http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/CustomUrls.html) should hopefully overcome some of the "routes too complicated" issue
[18:58:32] gambl0re: has joined #RubyOnRails
[18:59:26] wenj1_: has left #RubyOnRails: ()
[18:59:27] matthewd: dminuoso: https://github.com/rails/rails/blob/8479b79a0a4dad21a36e69a4502ff7414c250949/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb#L89 vs https://github.com/rails/rails/blob/8479b79a0a4dad21a36e69a4502ff7414c250949/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L233 -- looks like it might just be a missing feature?
[19:01:22] alfiemax: has joined #RubyOnRails
[19:01:33] matthewd: It does sound like information sqlite3 has: https://github.com/sparklemotion/sqlite3-ruby/blob/9a3cac98836e56567b29b13e0a88c8b853a578da/lib/sqlite3/resultset.rb#L159
[19:03:03] dminuoso: matthewd, alright I will do some investigations on this.
[19:04:47] workmad3: has joined #RubyOnRails
[19:09:06] alfiemax: has joined #RubyOnRails
[19:10:15] xaviergmail: has joined #RubyOnRails
[19:12:51] TViernion: has anyone runto the "Child already added" issue?
[19:20:24] dminuoso: TViernion, !rule3
[19:20:24] helpa: TViernion: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[19:20:54] TViernion: when running migrate the following error is https://gist.github.com/jasonmacer/72df75b3b8ff29505c5c12836700d5fe
[19:21:11] dminuoso: Please do include the migration.
[19:21:26] dminuoso: TViernion, also, this is a redmine issue. Please refer to their support.
[19:21:45] TViernion: and no one is there.. thats why im asking in here didn't know if anyone here has ever seen that
[19:22:24] dminuoso: I went to the Ford shop to buy a Ford, but there was no one there. So I went to the Peugout Shop. "Why wont you sell me a Ford?!"
[19:22:52] TViernion: That is not an apples to apples comparison
[19:23:14] TViernion: both applications run on RoR, hince coming into the RoR main chat to ask if anyone has seen it in any other isntances.
[19:24:11] dminuoso: TViernion, the exception is thrown from inside redmine with mostly redmine related stackframes.
[19:24:13] dminuoso: Its a redmine issue.
[19:25:57] hahuang65: has joined #RubyOnRails
[19:31:19] brycesenz: has joined #RubyOnRails
[19:32:25] brycesenz: Hi all. I have a gem, and I would like to make sure that it is compatible with the newest major version of a library it has a dependency. Are there any good RSpec practices/ways of testing against multiple versions of a dependency?
[19:33:23] xaviergmail: has joined #RubyOnRails
[19:36:43] matthewd: brycesenz: https://github.com/thoughtbot/appraisal may be relevant
[19:37:16] brycesenz: matthewd - yes, this looks perfect actually. Thanks!
[19:37:42] matthewd: https://schneems.com/post/50991826838/testing-against-multiple-rails-versions covers some simpler approaches, too
[19:39:47] jphase: has joined #RubyOnRails
[19:48:06] jphase: has joined #RubyOnRails
[20:05:50] ur5us: has joined #RubyOnRails
[20:13:43] dionysus69: has joined #RubyOnRails
[20:24:00] jphase: has joined #RubyOnRails
[20:54:24] bruno-: has joined #RubyOnRails
[21:05:12] workmad3: has joined #RubyOnRails
[21:16:29] alfiemax: has joined #RubyOnRails
[21:26:48] hahuang65: has joined #RubyOnRails
[21:30:41] marr: has joined #RubyOnRails
[21:38:34] alfiemax: has joined #RubyOnRails
[22:06:34] dionysus69: has joined #RubyOnRails
[22:19:27] hfp_work: has joined #RubyOnRails
[22:41:56] hammer065: has joined #RubyOnRails
[22:43:18] NoGodDamnIdea: has joined #RubyOnRails
[22:48:17] brycesenz: has joined #RubyOnRails
[22:57:49] Fafner13: has joined #RubyOnRails
[23:03:49] alfiemax: has joined #RubyOnRails
[23:06:03] workmad3: has joined #RubyOnRails
[23:11:58] jphase: has joined #RubyOnRails
[23:27:40] hahuang65: has joined #RubyOnRails
[23:44:14] jphase: has joined #RubyOnRails
[23:53:11] jphase: has joined #RubyOnRails
[23:57:58] alfiemax: has joined #RubyOnRails