« Back to channel list

#RubyOnRails - 23 February 2018

« Back 1 day Forward 1 day »
[00:02:48] espressocannon: i did not try this. I should mention I am about 2ish days into rails, and pretty new to ruby.
[00:03:00] espressocannon: I just finished the getting started with rails guide
[00:03:01] chouhoulis: has joined #RubyOnRails
[00:05:08] mroutis: espressocannon: cool, it's a good practice to name collections in plural, if @posting is going to contain several elements (as in your example) I'd name it @job_posts; to make the application more "readable"
[00:05:09] espressocannon: so are you suggesting making a loop from @postings on my overview page?
[00:05:34] cagomez: has joined #RubyOnRails
[00:05:51] espressocannon: then doing a <render posting> <link_to '...more'> kind of thing?
[00:06:50] mroutis: espressocannon: you don't need to loop it explicitly, @postings.first just retrieve the first element of the collection
[00:07:45] mroutis: espressocannon: doing a <render @job_posts.first> will "insert" the `_job_post` partial into your view
[00:09:40] mroutis: and then, you can use the ERB tag `<% %>` to check if rendering `show_more` is neccesary
[00:09:51] espressocannon: oops sorry my bad. I was unclear of the problem
[00:10:16] espressocannon: wait maybe not sorry give me a sec
[00:10:30] Radar: espressocannon: Can you create a Gist of the code you've got?
[00:10:31] Radar: espressocannon: !gist
[00:10:31] helpa: espressocannon: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:10:35] ResidentBiscuit: has joined #RubyOnRails
[00:11:19] MrPunkin: has joined #RubyOnRails
[00:14:06] chouhoulis: has joined #RubyOnRails
[00:15:38] mroutis: Is it possible to run a callback on a `has_and_belongs_to_many` association? (using `has_many through: :join_model`); `after_create` is not being triggered
[00:15:52] darkstego: has joined #RubyOnRails
[00:16:08] espressocannon: https://gist.github.com/ELI7VH/34956fd0d459eea98a09359071c50868
[00:16:44] espressocannon: i have included the index and _posting, also you can view the app if needed
[00:17:13] espressocannon: 209.89.72.56:3000/postings
[00:18:01] darkstego: I wanted to make a web application that extracts data from a preset database and display then in tables and graphs. Is RubyonRails the right tool for this?
[00:18:22] darkstego: I won't be doing any database input, just reading
[00:18:30] Radar: espressocannon: where do you want this "more" link to show?
[00:18:41] espressocannon: at the bottom of the _posting
[00:18:53] espressocannon: *if* the render function is iterating
[00:19:00] Radar: espressocannon: Why not do the check in the index template?
[00:19:10] Radar: <% if @postings.count > 1 %> Show more <% end %>
[00:19:24] Radar: as mroutis suggested
[00:19:36] espressocannon: but how can you put that between the iterates?
[00:19:39] chouhoulis: has joined #RubyOnRails
[00:19:49] Radar: You don't need to.
[00:19:51] Radar: put it after the render.
[00:20:15] espressocannon: oh... so 'more" is actually the post itself with the comments
[00:20:25] espressocannon: so it would have to be on every iteration
[00:20:54] espressocannon: but I think it makes more sense to just make a _postings.html.erb for this
[00:21:19] espressocannon: its just that, that doesn't make sense becasue the template itself is a single item
[00:21:53] espressocannon: or should I just do a loop at this point, inside the "_postings" partial
[00:21:55] Radar: What would this "show more" link do once it was clicked?
[00:22:35] espressocannon: http://209.89.72.56:3000/postings/3
[00:22:56] espressocannon: it would show the full post with comments. in the future this will be the job with the applicants
[00:23:02] mroutis: espressocannon: I added a comment on your gist
[00:23:50] sameerynho: has joined #RubyOnRails
[00:23:58] mroutis: darkstego: Why are you doubting using Ruby on Rails
[00:24:19] espressocannon: yeah so @mroutis. This is actually not the direction I was going. I'm actully trying to display comments on each post.
[00:24:31] espressocannon: "full details" if you will
[00:24:57] espressocannon: however I don't need that in the "show" template, because you don't need to show full details on the page that is already showing the details
[00:24:58] chouhoulis: has joined #RubyOnRails
[00:25:25] espressocannon: also yeah @darkstego, from my extremely limited knowledge of rails that sounds ike a trivial project.
[00:25:26] jenrzzz: has joined #RubyOnRails
[00:25:33] darkstego: mroutis: I wanted to know if Ruby on Rails was overkill for what I wanted
[00:26:17] darkstego: I know you can do a lot of great stuff with rails, but I was just wondering if it was the right tool for the job for something like this.
[00:26:26] mroutis: darkstego: why are you worried about "overkilling" it?
[00:27:07] mroutis: espressocannon: I don't understand what you want to achieve, if you can attach to the gist a graphical example it would make the it easier for me
[00:28:59] espressocannon: well I decided to just make a separate partial, with specific stuff. I am just trying to not DRY haha. I want to try and follow conventions as closely as possible.
[00:30:05] espressocannon: i appreciate the help. that @postings.first will come in handy!
[00:30:10] jenrzzz: hey rails peeps, I'm building an app that needs to work with models owned by another app as well as its own ActiveRecord models. I've implemented some ActiveResource-like interfaces on the foreign models to allow them to be associated with my ActiveRecord models and now I'm wondering if it'd be possible to hack in some eager-loading functionality for those foreign associations. Basically, it'd be
[00:30:17] jenrzzz: awesome to call .includes on either kind of association proxy and have it generate a single SQL query or a single call to the foreign API to fetch all the needed records
[00:30:31] chouhoulis: has joined #RubyOnRails
[00:30:48] espressocannon: @darkstego - the worst that can happen is that you get it done faster than normal. I say go for it with rails.
[00:31:17] darkstego: mroutis: by overkill I mean I didn't want to do something in a tool that would be overly complicated to achieve the same goal, kinda like writing a C program in place of a ruby script for something simple
[00:31:19] mroutis: jenrzzz: woah, that's a cool problem! are you using postgres? and if so, did you already look the foreign data mappers?
[00:31:21] jenrzzz: It doesn't seem like something people often want to do judging from the docs so I was wondering if it'd be worth spelunking through the AR eager loading code or if I should just take another approach
[00:31:51] darkstego: to be honest I don't know what the ruby web framework landscape looks like these days
[00:32:00] darkstego: last time I looked at it was almost 10 years ago
[00:32:29] jenrzzz: mroutis: yeah, I want to handle it at the app level rather than database so the foreign app can apply business rules to the API requests. they are mostly separate domains with a few overlapping models
[00:33:17] mroutis: jenrzzz: mhm, are you doing the AR interface by yourself, right? did you check https://github.com/remiprev/her ?
[00:33:48] mroutis: they don't have "eager loading" as far as I know, but you can use `memcached` to prevent requesting innecesary data
[00:33:50] bga57: has joined #RubyOnRails
[00:34:37] jenrzzz: mroutis: yeah, looked into her at the beginning but was afraid of falling to the same pitfalls as ActiveResource. i might take another look at it though, thanks for reminding me :)
[00:34:56] desnudopenguino: has joined #RubyOnRails
[00:36:04] chouhoulis: has joined #RubyOnRails
[00:36:23] mroutis: jenrzzz: we had several problems with faraday, tho... (the API we were consuming didn't have a common structure, so we ended writing our own faraday adapter)
[00:36:51] jenrzzz: mroutis: yeah I got the feeling that I'd be writing lots of middlewares to make things work the way I want
[00:37:40] mroutis: jenrzzz: by business rules you mean using active validations to control the read/write ?
[00:39:32] mroutis: jenrzzz: it's interesting that as a consumer you want to apply business rules, wouldn't be easier if the API manage those bizrules?
[00:40:33] alfiemax: has joined #RubyOnRails
[00:41:01] Yzguy: has joined #RubyOnRails
[00:41:44] chouhoulis: has joined #RubyOnRails
[00:42:11] jenrzzz: mroutis: uhhh, could be just about anything. the main thing this app submits to the other are requests for physical hardware to use for testing, and the other app decides what can be used to fulfill those requests
[00:42:45] espressocannon: btw any atom users in here?
[00:43:01] jenrzzz: mroutis: sorry, I meant we want consume the HTTP api so the other app can apply those rules. as opposed to using FDW to talk to its database
[00:44:10] jenrzzz: mroutis: also we're trying to use a database-as-a-service solution that's part of the platform we're deploying on and it doesn't support postgres extensions :/
[00:44:51] mroutis: jenrzzz: being there, restricted by the vendor, not cool
[00:47:23] chouhoulis: has joined #RubyOnRails
[00:52:38] chouhoulis: has joined #RubyOnRails
[00:57:03] mroutis: how do you manage creation callbacks on a `join_model`? they aren't being triggered at all, just when creating the association by hand `JoinModel.create(x: x, y: y)`
[00:57:12] jenrzzz: I really wish there was some ActiveAssociation gem that encapsulated all the necessary stuff for associations with nice public interfaces. I want to associate all the things!
[00:58:10] chouhoulis: has joined #RubyOnRails
[00:59:32] jenrzzz: mroutis: hmmm, they shouldn't work any differently on a join model. are you sure that #create is succeeding?
[01:02:48] chouhoulis: has joined #RubyOnRails
[01:05:02] mroutis: jenrzzz: yeah, here's a gist https://gist.github.com/mroutis/8e9f0f2c8c90c2fb420d6d57539a4461
[01:05:42] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[01:06:32] mroutis: Radar: fake values being X and Y?
[01:06:56] mroutis: has joined #RubyOnRails
[01:07:22] Radar: It means you have to do a double translation: when talking to us and when we give code back to you. Just use regular terms.
[01:07:32] mheld: has joined #RubyOnRails
[01:08:16] chouhoulis: has joined #RubyOnRails
[01:09:07] mroutis: Radar: mhm, okok, got it
[01:13:54] mroutis: has joined #RubyOnRails
[01:15:32] espressocannon: has joined #RubyOnRails
[01:15:56] espressocannon: is there any way to generate a form based on all it's fields in template
[01:17:18] espressocannon: also, it just seems redundant to me that I have to "permit.()" fields, when my app knows all the fields that are in the database already.
[01:17:29] espressocannon: that i should permit*
[01:18:13] mroutis: espressocannon: sometimes, you don't want a user to modify everything that's in the table you are modeling
[01:19:17] alfie: has joined #RubyOnRails
[01:19:17] chouhoulis: has joined #RubyOnRails
[01:19:17] mroutis: espressocannon: for example, imagine you have an `is_admin` field in your users table, and some clever user adds a `is_admin=1` param to your #create / #update
[01:19:25] espressocannon: fair enough. In the docs it said to permit all the things in your table to prevent against malicious attack, I just think it should have a "permit all submissions from fields that exist in your tables" for certain things
[01:19:53] espressocannon: my plan is to not even render things if they aren't admin
[01:20:02] espressocannon: I do see what you're getting at though.
[01:20:03] jenrzzz: mroutis: can't find any good resources on that but callbacks and has_many through: (and polymorphism) are the flakiest parts of AR for me so I would expect some surprises using them all together
[01:20:22] jenrzzz: mroutis: this answer makes it sound like you should use after_add on the collection instead of after_create on the join model: https://stackoverflow.com/questions/10597878/howto-use-callbacks-in-a-has-many-through-association
[01:21:37] mroutis: espressocannon: users can also query your application by submiting a request to your site, it doesn't matter if they are using a web client for that (as with curl)
[01:21:43] mroutis: jenrzzz: thank you!
[01:21:58] mroutis: jenrzzz: I appreciate the effort :p
[01:24:48] chouhoulis: has joined #RubyOnRails
[01:25:01] espressocannon: ok so real life question, you're saying that for my "new user" form
[01:25:05] espressocannon: https://gist.github.com/ELI7VH/6566d7958c99c5b6ae0cae24b6b79f29
[01:25:36] cagomez: has joined #RubyOnRails
[01:25:47] espressocannon: I have to make a 'posting_params' method like this:
[01:26:26] espressocannon: params.require(:user).permit(:name,:phone_number,:city,:email,.......,........,.......,.......,.......,......,......,......,......,......)
[01:28:55] mroutis: espressocannon: it's recommended, not enforced. Rails follows the "convention vs configuration" philosophy, where using `strong_params` is the convention
[01:29:34] cagomez: has joined #RubyOnRails
[01:29:47] espressocannon: is there not a shortcut to that somehow? like instead of listing 25 fields, just do a "dont include these fields" in the .permit()
[01:30:28] chouhoulis: has joined #RubyOnRails
[01:31:27] morenoh149: has joined #RubyOnRails
[01:31:33] espressocannon: for example. for my 'users' table, the listof "don't include" is ':activation_date' as well as the builtins like creation and modification dates.
[01:31:51] mroutis: `params.require(:user).permit(User.attribute_names)`
[01:32:52] alfiemax: has joined #RubyOnRails
[01:33:08] jenrzzz: espressocannon: what mroutis said, but be aware that you are circumventing a well-thought out security feature
[01:33:45] mroutis: espressocannon: if you want to exclude some attributes, you can chain the call to `.exclude(:created_at, :updated_at)`
[01:34:23] mroutis: espressocannon: sorry, I forgot to use the splash operator... `(*User.attribute_names.map(&:to_sym))`
[01:35:55] chouhoulis: has joined #RubyOnRails
[01:36:10] espressocannon: yeah, I'm not suggesting I know better, but during my learning curve I am going to be spending so much time going back and forth, also for things like creating large user profiles, where the view is /user/new - if somebody were to try and hack that, the worst they could do is make a user with all the fields that I want them to right? (if i were to exclude the builtin ones as well as the 1 or 2 ones for admin only)
[01:37:13] espressocannon: there is also the very real possibility that i am a huge noob and my tables shouldn't have this many fields. I am extremely new to databases.
[01:40:13] chouhoulis: has joined #RubyOnRails
[01:44:43] chouhoulis: has joined #RubyOnRails
[01:49:08] chouhoulis: has joined #RubyOnRails
[01:49:56] mroutis: espressocannon: my 2c, you should aspire to develop the sufficient knowledge of a language/tool to express a complex system correctly and easy to understand, more than hacking a quick and fast frontend that read/write data to a database
[01:53:09] mroutis: espressocannon: rails is not perfect to express every single web application, but it has a pretty decent approach to express at least a first draft of your app without the hassle of dealing with details of the language
[01:53:12] espressocannon: yeah I am working on doing that tbh. It just doesn't make sense that I would be writing 20-30 fields in the .permit() method, when it makes more sense to permit all from the list and then exclude the 3-4 that you don't want in there..
[01:54:17] mroutis: espressocannon: I guess they did it to promote explicitness
[01:54:22] espressocannon: this is just a little nitpick honestly. I'm just tryng to see the logic behind it, that convention over config (from the example they gave in the tutorial) alluded to writing 'less'
[01:54:46] espressocannon: do you have applications where you are permitting a ton of fields in that method?
[01:54:48] chouhoulis: has joined #RubyOnRails
[01:56:04] mroutis: espressocannon: actually, yes
[01:56:32] Dimik: has joined #RubyOnRails
[01:56:50] espressocannon: so you just put in a giant list of them? just like one after the other on that line?
[01:58:06] mroutis: espressocannon: https://github.com/gitlabhq/gitlabhq/blob/master/app/controllers/admin/groups_controller.rb#L74-L90
[01:58:36] mroutis: espressocannon: that's an example of gitlab, I don't work right there, neither wrote that code, but that's an example of how I'm used to organize my params
[01:58:47] espressocannon: oh well that's at least more readable
[01:59:46] espressocannon: wasn't sure if that kind of thing was .... allowed.
[01:59:59] chouhoulis: has joined #RubyOnRails
[02:02:59] alfiemax: has joined #RubyOnRails
[02:05:38] chouhoulis: has joined #RubyOnRails
[02:11:04] mroutis: espressocannon: your welcome
[02:11:13] chouhoulis: has joined #RubyOnRails
[02:16:52] chouhoulis: has joined #RubyOnRails
[02:19:00] orbyt_: has joined #RubyOnRails
[02:22:25] chouhoulis: has joined #RubyOnRails
[02:25:28] morenoh149: has joined #RubyOnRails
[02:26:51] chouhoulis: has joined #RubyOnRails
[02:30:00] cagomez: has joined #RubyOnRails
[02:32:13] chouhoulis: has joined #RubyOnRails
[02:37:33] chouhoulis: has joined #RubyOnRails
[02:38:30] alfiemax: has joined #RubyOnRails
[02:39:37] espressocannon: "proserve_expires"=>{"year"=>"2019", "month"=>"4", "day"=>"19"} - so this is the object that was tossed int my database
[02:40:01] espressocannon: i am trying to access it in my template by using @user.proserve_expires but it returns nothing
[02:40:25] espressocannon: I have tried @user.proserve_expires.year and also ['year']
[02:41:45] espressocannon: my table field is "t.date"
[02:42:20] espressocannon: and I used "<%= select_date %> to get it
[02:43:23] chouhoulis: has joined #RubyOnRails
[02:48:38] chouhoulis: has joined #RubyOnRails
[02:54:17] chouhoulis: has joined #RubyOnRails
[02:59:53] chouhoulis: has joined #RubyOnRails
[03:01:07] AnotherOne: has joined #RubyOnRails
[03:02:34] cagomez: has joined #RubyOnRails
[03:05:23] chouhoulis: has joined #RubyOnRails
[03:08:12] mroutis: has joined #RubyOnRails
[03:08:42] wethu: has joined #RubyOnRails
[03:10:54] chouhoulis: has joined #RubyOnRails
[03:12:24] darkhanb: has joined #RubyOnRails
[03:16:23] chouhoulis: has joined #RubyOnRails
[03:19:27] morenoh149: has joined #RubyOnRails
[03:20:24] egray: has joined #RubyOnRails
[03:21:57] chouhoulis: has joined #RubyOnRails
[03:23:13] egray: has joined #RubyOnRails
[03:25:40] mitt3ns: has joined #RubyOnRails
[03:27:34] chouhoulis: has joined #RubyOnRails
[03:33:13] chouhoulis: has joined #RubyOnRails
[03:38:38] chouhoulis: has joined #RubyOnRails
[03:44:09] chouhoulis: has joined #RubyOnRails
[03:45:06] aguestuser: has joined #RubyOnRails
[03:46:50] agent_white: has joined #RubyOnRails
[03:49:33] chouhoulis: has joined #RubyOnRails
[03:54:20] chouhoulis: has joined #RubyOnRails
[03:56:26] mheld: has joined #RubyOnRails
[03:58:04] cagomez: has joined #RubyOnRails
[03:59:49] chouhoulis: has joined #RubyOnRails
[04:05:24] chouhoulis: has joined #RubyOnRails
[04:10:43] chouhoulis: has joined #RubyOnRails
[04:13:27] morenoh149: has joined #RubyOnRails
[04:16:28] chouhoulis: has joined #RubyOnRails
[04:19:54] TerianceVi: has joined #RubyOnRails
[04:21:55] chouhoulis: has joined #RubyOnRails
[04:24:04] agent_white: has joined #RubyOnRails
[04:25:16] trautwein: has joined #RubyOnRails
[04:27:22] chouhoulis: has joined #RubyOnRails
[04:27:41] morenoh149: has joined #RubyOnRails
[04:33:02] chouhoulis: has joined #RubyOnRails
[04:33:39] kapil___: has joined #RubyOnRails
[04:33:46] Tempesta: has joined #RubyOnRails
[04:38:28] chouhoulis: has joined #RubyOnRails
[04:44:00] chouhoulis: has joined #RubyOnRails
[04:47:47] aguestuser: has joined #RubyOnRails
[04:49:28] chouhoulis: has joined #RubyOnRails
[04:52:11] JoshL: has joined #RubyOnRails
[04:52:26] Brisk-Branded: has joined #RubyOnRails
[04:54:56] chouhoulis: has joined #RubyOnRails
[04:59:29] chouhoulis: has joined #RubyOnRails
[04:59:59] kies: has joined #RubyOnRails
[05:05:00] chouhoulis: has joined #RubyOnRails
[05:10:28] chouhoulis: has joined #RubyOnRails
[05:16:03] chouhoulis: has joined #RubyOnRails
[05:21:50] chouhoulis: has joined #RubyOnRails
[05:21:52] Brisk-Branded: has joined #RubyOnRails
[05:22:49] elcontrastador: has joined #RubyOnRails
[05:26:14] JoshL: has joined #RubyOnRails
[05:27:07] chouhoulis: has joined #RubyOnRails
[05:32:30] chouhoulis: has joined #RubyOnRails
[05:38:00] chouhoulis: has joined #RubyOnRails
[05:41:16] dustinm`: has joined #RubyOnRails
[05:43:51] chouhoulis: has joined #RubyOnRails
[05:45:56] morenoh149: anyone ever use dbeaver to ramp up on a new project's data model?
[05:47:56] morenoh149: I'm seeing something odd, there are tables named cities_users with keys city_id and user_id but there is no line from cities_users to the cities table
[05:48:16] morenoh149: it must simply be an integer field and not a true database foreign key
[05:49:17] chouhoulis: has joined #RubyOnRails
[05:51:38] morenoh149: I'm seeing city.rb has ` has_many :cities_users` and ` has_many :users, through: :cities_users` shouldn't that create foreign keys?
[05:54:44] chouhoulis: has joined #RubyOnRails
[05:55:47] morenoh149: oh schema.db needs something like ` add_foreign_key "city_contents", "cities"` in order to create a foreign key
[05:59:19] chouhoulis: has joined #RubyOnRails
[06:04:57] chouhoulis: has joined #RubyOnRails
[06:10:15] chouhoulis: has joined #RubyOnRails
[06:16:02] chouhoulis: has joined #RubyOnRails
[06:21:33] chouhoulis: has joined #RubyOnRails
[06:32:39] chouhoulis: has joined #RubyOnRails
[06:37:16] srinidhi: has joined #RubyOnRails
[06:38:09] chouhoulis: has joined #RubyOnRails
[06:43:41] chouhoulis: has joined #RubyOnRails
[06:49:43] mtkd: has joined #RubyOnRails
[06:53:19] chouhoulis: has joined #RubyOnRails
[06:57:37] srinidhi: has joined #RubyOnRails
[06:59:11] chouhoulis: has joined #RubyOnRails
[07:03:37] chouhoulis: has joined #RubyOnRails
[07:06:28] morenoh149: has joined #RubyOnRails
[07:08:56] chouhoulis: has joined #RubyOnRails
[07:13:26] snickers: has joined #RubyOnRails
[07:14:23] chouhoulis: has joined #RubyOnRails
[07:19:57] chouhoulis: has joined #RubyOnRails
[07:25:28] chouhoulis: has joined #RubyOnRails
[07:30:06] chouhoulis: has joined #RubyOnRails
[07:31:58] helpa: has joined #RubyOnRails
[07:33:55] Cork: has joined #RubyOnRails
[07:34:28] chouhoulis: has joined #RubyOnRails
[07:35:06] conta: has joined #RubyOnRails
[07:37:00] Psy-Q: has joined #RubyOnRails
[07:38:43] ghormoon: has joined #RubyOnRails
[07:39:52] chouhoulis: has joined #RubyOnRails
[07:47:47] conta1: has joined #RubyOnRails
[07:51:09] chouhoulis: has joined #RubyOnRails
[07:53:26] JoshL: has joined #RubyOnRails
[07:53:26] kies: has joined #RubyOnRails
[07:53:26] roshanavand: has joined #RubyOnRails
[07:53:26] lupine: has joined #RubyOnRails
[07:53:26] LightStalker: has joined #RubyOnRails
[07:53:26] dmcc: has joined #RubyOnRails
[07:53:26] r3my: has joined #RubyOnRails
[07:53:26] epochwolf: has joined #RubyOnRails
[07:55:11] crst: has joined #RubyOnRails
[07:55:19] crst: Good Morning
[07:55:34] morenoh149: has joined #RubyOnRails
[07:57:39] alfie: has joined #RubyOnRails
[07:57:39] prooftechnique_: has joined #RubyOnRails
[07:57:39] EXCHGR: has joined #RubyOnRails
[07:57:39] dyyylan: has joined #RubyOnRails
[07:57:39] beingjohnm: has joined #RubyOnRails
[07:57:39] jrm: has joined #RubyOnRails
[07:57:39] xtsee: has joined #RubyOnRails
[08:02:15] LenPayne: has joined #RubyOnRails
[08:17:01] gaucheph: has joined #RubyOnRails
[08:19:25] dionysus69: has joined #RubyOnRails
[08:22:29] dmcc: has joined #RubyOnRails
[08:22:42] r3my: has joined #RubyOnRails
[08:22:42] kies: has joined #RubyOnRails
[08:22:50] epochwolf: has joined #RubyOnRails
[08:22:50] lupine: has joined #RubyOnRails
[08:22:55] roshanavand: has joined #RubyOnRails
[08:23:00] JoshL: has joined #RubyOnRails
[08:23:04] LightStalker: has joined #RubyOnRails
[08:30:32] darkhanb: has joined #RubyOnRails
[08:31:57] reber: has joined #RubyOnRails
[08:33:15] EXCHGR: has joined #RubyOnRails
[08:33:15] alfie: has joined #RubyOnRails
[08:33:19] jrm: has joined #RubyOnRails
[08:33:20] ProofTechnique: has joined #RubyOnRails
[08:33:32] xtsee: has joined #RubyOnRails
[08:33:40] dyyylan: has joined #RubyOnRails
[08:34:18] beingjohnm: has joined #RubyOnRails
[08:49:38] morenoh149: has joined #RubyOnRails
[08:52:58] za1b1tsu: has joined #RubyOnRails
[08:57:33] Fusselgesicht: has joined #RubyOnRails
[09:00:20] marr: has joined #RubyOnRails
[09:02:38] wethu: has joined #RubyOnRails
[09:03:02] kies: has joined #RubyOnRails
[09:05:50] mikecmpbll: has joined #RubyOnRails
[09:08:16] sameerynho: has joined #RubyOnRails
[09:15:58] gaucheph: has left #RubyOnRails: ()
[09:24:53] aiguuu: has joined #RubyOnRails
[09:29:34] wethu: has joined #RubyOnRails
[09:37:27] mtkd: has joined #RubyOnRails
[09:42:25] quazimodo: has joined #RubyOnRails
[09:43:39] morenoh149: has joined #RubyOnRails
[10:14:24] srinidhi: has joined #RubyOnRails
[10:18:52] bijan_: has joined #RubyOnRails
[10:23:30] bijan_: has joined #RubyOnRails
[10:24:33] bijan__: has joined #RubyOnRails
[10:28:21] riotjones: has joined #RubyOnRails
[10:37:34] morenoh149: has joined #RubyOnRails
[10:44:07] mikecmpbll: what would be the best way to assert that any record of a model is destroyed in a block in tests?
[10:44:22] mikecmpbll: (others may also be created, i just want to assert that at least one is also destroyed)
[10:44:54] dminuoso: mikecmpbll: Then assert exactly that
[10:45:11] mikecmpbll: dminuoso : thanks, you're so insightful!
[10:45:50] dminuoso: mikecmpbll: Your details are not very clear.
[10:45:57] mikecmpbll: dminuoso : how so?
[10:46:14] dminuoso: mikecmpbll: "Any record of a model is destroyed" sounds like an antitest.
[10:46:17] dminuoso: mikecmpbll: Test for behavior.
[10:46:25] mikecmpbll: that is a behaviour.
[10:46:27] dminuoso: mikecmpbll: Whats the external visible behavior?
[10:46:34] dminuoso: Does the count of records change?
[10:46:38] dminuoso: Does a _specific_ record disappear?
[10:46:44] dminuoso: Does a _specific_ record appear?
[10:47:33] dminuoso: mikecmpbll: If you absolutely need to test just that destruction is invoked, use a mock
[10:47:47] dminuoso: so that you can expect that the method .destroy is invoked
[10:48:02] mikecmpbll: hm, could do.
[10:49:13] dminuoso: mikecmpbll: rspec or minitest?
[10:51:35] Ergo: has joined #RubyOnRails
[10:52:07] dminuoso: mikecmpbll: To me the fact that "any object is destroyed" does not sound like well behaved. I mean what if the method rampages and does Model.destroy_all
[10:52:17] dminuoso: That's what I meant with "specific behavior"
[10:53:31] mikecmpbll: fair point. i'm forgoing a little bit of specificity in order not to have to write 100 tests instead of 1. it's a compromise i'm willing to take.
[10:54:16] mikecmpbll: it's testing an data import process. we use fixtures & i don't want to have to hardcode the nature of the fixtures for the models into the tests
[10:54:31] mikecmpbll: if we add additional fixtures it'll delete more records.
[10:54:40] Nikamura: has joined #RubyOnRails
[10:55:33] srinidhi: has joined #RubyOnRails
[11:00:02] mikecmpbll: trying to test an import process against an uncertain starting point is the main issue. probably could just kablam the fixtures for these tests and use different ones. meh
[11:07:18] Cavallari: has joined #RubyOnRails
[11:08:38] Cavallari: has joined #RubyOnRails
[11:10:26] srinidhi: has joined #RubyOnRails
[11:20:23] hmaronon: has joined #RubyOnRails
[11:21:29] apparition: has joined #RubyOnRails
[11:31:35] morenoh149: has joined #RubyOnRails
[11:48:11] morenoh149: has joined #RubyOnRails
[11:56:29] MrCrackPotBuilde: has joined #RubyOnRails
[11:56:41] powrtoch: has joined #RubyOnRails
[11:57:21] MrCrackPotBuilde: Hi if i use attr_accessor :email, :email_confirmation in my user.rb model do i still have to right all the same tests or will it use the tests for email ???
[12:02:55] mtkd: has joined #RubyOnRails
[12:20:26] defsdoor: has joined #RubyOnRails
[12:21:24] hmaronon: has joined #RubyOnRails
[12:38:19] hmaronon: has joined #RubyOnRails
[12:41:18] wethu: has joined #RubyOnRails
[12:51:37] DrYockel: has joined #RubyOnRails
[13:13:53] roshanavand: has joined #RubyOnRails
[13:57:00] conta: has joined #RubyOnRails
[14:01:16] DoubleMalt: has joined #RubyOnRails
[14:03:50] wethu: has joined #RubyOnRails
[14:06:54] DoubleMalt: has joined #RubyOnRails
[14:10:37] riotjoe: has joined #RubyOnRails
[14:12:26] thomasfedb: MrCrackPotBuilde, attr_accessor isn't an alias
[14:27:50] MrCrackPotBuilde: thomasfeedb its for getters and setters variables but wouldnt that apply to the confirmation fields too
[14:28:15] MrCrackPotBuilde: for the password confirmation i just have one test but it works for both the password field and the password confirmation
[14:31:13] thomasfedb: MrCrackPotBuilde, why are you testing the confirmation field?
[14:31:30] thomasfedb: MrCrackPotBuilde, getters and setters are created by rails automagically
[14:31:32] MrCrackPotBuilde: i want to make sure that it is the same as the email
[14:32:01] MrCrackPotBuilde: rails didnt auto create the email confirmation so i added it in as email_confirmation
[14:32:42] MrCrackPotBuilde: if you follow the railstutorial michael hartl i tried to copy the effect of the password_confirmation field
[14:32:56] MrCrackPotBuilde: but initialy just adding email_confirmation failed
[14:33:22] MrCrackPotBuilde: and because i cant word it in english properly every google search comes up with email validation which i can already do
[14:41:33] safetypin: has joined #RubyOnRails
[14:43:55] MrCrackPotBuilde: i figured it out
[14:44:13] MrCrackPotBuilde: had to add confirmation: true to the end of validates email
[14:45:09] phon: has joined #RubyOnRails
[14:45:48] thomasfedb: MrCrackPotBuilde, that's the one
[14:46:41] MrCrackPotBuilde: from looking further i can see the password_confirmation has some background automated stuff that the email_confirmation doesnt have
[14:48:52] jottr: has joined #RubyOnRails
[14:58:04] rietta: has joined #RubyOnRails
[15:00:32] rietta: has left #RubyOnRails: ()
[15:07:53] moei: has joined #RubyOnRails
[15:15:25] mikecmpb_: has joined #RubyOnRails
[15:16:22] riotjoe: has joined #RubyOnRails
[15:17:54] [Butch]: has joined #RubyOnRails
[15:20:13] lupine: anyone familiar with the batch_loader gem? I'm trying to nest it, and it's not working as I expect.
[15:21:22] lupine: in particular, I'm doing something like: `project = BatchLoader.for(project_id).batch { ... } ; BatchLoader.for(dependent_id).batch { ...where(project_id: project.id)... }`
[15:24:42] thomasfedb: lupine, rails has in_batches build in
[15:24:55] thomasfedb: lupine, does that not do what you need?
[15:34:44] lupine: it doesn't, batch_loader coalesces finds into fewer queries
[15:35:05] lupine: in_batches is just a wrapper around a cursor
[16:05:52] Exuma: has joined #RubyOnRails
[16:06:19] Exuma: How do I validate a type in rails without casting it? Its critical that an amount is an integer, and I want to raise, but rails keeps rounding floats to integer, adding an error, but the 2nd time you store its valid because rails overwrote the original value
[16:06:26] Exuma: how do I just raise unless a value is an integer
[16:09:32] dminuoso: Exuma: What do you mean by "rails keeps rounding floats to integer"
[16:09:44] dminuoso: Exuma: You get numericality validations out of the box.
[16:09:45] Exuma: my DB column is an integer column (amount of cents)
[16:09:55] Exuma: so rails keeps converting 120.20 to 120
[16:10:07] Exuma: this seems insane to me, if its trying to validate it why would it round it before its a valid number
[16:10:20] Exuma: basically i want to raise if its anything other htan an integer
[16:10:45] Exuma: or at the very least prevent the value from being stored in its rounded state
[16:10:54] Exuma: because that means the second time save is called it will work, even though its a completely wrong number
[16:11:17] dminuoso: 17:09 Exuma | so rails keeps converting 120.20 to 120
[16:11:21] dminuoso: Rails does not convert 120.20 to 120.
[16:11:36] dminuoso: Some specific code does.
[16:11:41] dminuoso: So please show us the specific code.
[16:11:54] Exuma: there is no "specific code", that is what its doing
[16:11:59] Exuma: its an empty model with a single validation
[16:12:07] Exuma: LineItem.new(amount: 120.50)
[16:12:09] Exuma: yields...
[16:12:15] dminuoso: Exuma: When I enter "120.20" into a text field, and hit submit, then I get a parameter that reads "120.20"
[16:12:18] Exuma: .errors has "must be integer"
[16:12:51] Exuma: x = LineItem.new(amount: 120.50)
[16:12:52] Exuma: #=> #<LineItem:0x00007ff05d35aed0 id: nil, journal_entry_id: nil, shared_account_id: nil, amount: 150, side: nil>
[16:12:57] Exuma: that is literally showing it right there
[16:13:02] Exuma: its casting it to the data type of teh database
[16:13:25] Exuma: it should say 150.50, that was 2 separate examples. same result though
[16:13:37] mikecmpbll: has joined #RubyOnRails
[16:14:36] dminuoso: Exuma: Rails comes with numericality validations out of the box.
[16:14:46] dminuoso: Exuma: They offer an only_integer setting.
[16:14:46] Exuma: are you reading what im saying?
[16:14:57] Exuma: im aware of all the. validations
[16:15:13] Exuma: im asking how do you prevent rails from casting floats to the data type of the field
[16:15:24] dminuoso: Exuma: What exactly do you want rails to do?
[16:15:41] Exuma: i want it to leave the field blank, or leave it as an float, so you cant hit save a 2nd time and it magically works with the WRONG value
[16:15:54] dminuoso: Exuma: Mmm.
[16:16:00] dminuoso: Exuma: You could try setting the attribute to :float
[16:16:11] dminuoso: Might have some weird and undesirable consequences though
[16:16:19] Exuma: i dont want it to be a float, i want it to be an integer, thats the whole point (its an amount of cents)
[16:16:29] dminuoso: Exuma: I know.
[16:16:39] dminuoso: Exuma: though Im a bit confused
[16:16:53] crst: Any idea how one can make the following with chartkick: There's a table bills, each record has a number value and a date. Now I'd like to group the x-axis my month (or else) and show the number values on the y-axis. (I'm actually trying to create a profit over time chart)
[16:17:19] dminuoso: Exuma: The best thing that comes to mind is that you use a helper attribute in which you keep the amount.
[16:17:26] dminuoso: This means you cant rely on rails magic anymore.
[16:18:17] dminuoso: Exuma: In my opinion the best thing you can do is prevent the input field from allowing something other than integer.
[16:18:54] jottr_: has joined #RubyOnRails
[16:19:02] Exuma: that's not the best idea to me, otherwise why have validations at all? the entire point is to ensure integrity of data
[16:19:12] Exuma: ensuring proper validations on a form isnt protecting the data at the deepest level
[16:19:25] dminuoso: Exuma: you can still have validations.
[16:19:53] dminuoso: Exuma: if you have validations you have the application level constraint, the <input type="number" min="0" step="1" /> will prevent the described issue from becoming a UI issue
[16:20:13] havenwood: Exuma: You want to coerce `120.0` but raise with `120.20` or raise with both?
[16:20:22] dminuoso: havenwood: he wants the model to remember the float point
[16:20:27] Exuma: i want to always raise if its anything other than an integer
[16:20:31] Exuma: i want the entire app to explode in fire
[16:20:40] dminuoso: havenwood: so that if q.save fails and rerenders the form, it will keep the "non-integer" value
[16:20:41] Exuma: because its related to accounting its absolutely vital things arent being rounded
[16:20:55] Exuma: its ok if it deletes the entire value even
[16:20:59] Exuma: its better than rounding and not noticing
[16:21:06] Exuma: and saving again
[16:21:06] dminuoso: Exuma: make the <input /> like I described and it becomes a non issue.
[16:21:11] dminuoso: keep the only_integer constraint
[16:21:11] Exuma: im not making the input like that
[16:21:28] Exuma: i hate input number boxes, and that isnt answering my question
[16:21:31] Exuma: youre talkinga bout forms and UI
[16:21:37] dminuoso: Exuma: then dont use magic assignment.
[16:21:40] Exuma: im talking about data integrity
[16:21:41] dminuoso: Exuma: populate the <input> from hand
[16:21:56] dminuoso: Quit using magic rails form builder magic.
[16:21:56] Exuma: well first of al im not even using an UI at all right now, im writing all the core logic
[16:22:05] Exuma: just pretend im not even using a form whatsoever
[16:22:08] Exuma: and that its an API
[16:22:10] Exuma: hwo do i do it then
[16:22:14] dminuoso: Exuma: You have access to params.
[16:22:20] dminuoso: Which means you can see what the user submitted.
[16:22:26] Exuma: pretend its all internal and im reading it from a CSV
[16:22:34] Exuma: youre saying i should validate not in the model then
[16:22:37] Exuma: which... yes i can do
[16:22:42] Exuma: but that goes back to my original point
[16:22:50] Exuma: i wanted something in the model to validate it, just like my other validations. thats teh whole point of them
[16:22:55] Exuma: is that i dont do the 'checking' outside the object
[16:22:59] Exuma: its at the time of create/update
[16:23:13] dminuoso: Exuma: No the point is to not rerender a form from an invalid model.
[16:23:22] Exuma: there is no form
[16:23:25] Exuma: theres no params
[16:23:51] dminuoso: we can fix ar
[16:24:03] Exuma: i feel like im taking crazy pills here. maybe ill just remove the data if its not an integer, inside a custom validate method?
[16:24:14] Exuma: that iseems really lame though
[16:24:26] Exuma: i was hoping to just raise... im raising inside a custom validate method but it doesnt appear to be getting caught
[16:24:32] dminuoso: Exuma: No its definitely AR internal type casting
[16:24:34] dminuoso: which you can work around
[16:24:41] dminuoso: but I really wouldnt
[16:24:52] dminuoso: Exuma: Essentially the problems happens because you try to read out from an invalid model
[16:24:53] Exuma: does before_validation happen before it casts it?
[16:25:09] dminuoso: Exuma: Pretty sure yeah
[16:25:21] Yzguy: has joined #RubyOnRails
[16:25:23] dminuoso: Exuma: try consulting raw_attribtues
[16:25:26] Exuma: how can i raise inside before_validation, it seems to be getting rescued or something
[16:25:27] dminuoso: Im curious if that contains the uncasted
[16:25:34] dminuoso: *raw_attributes
[16:25:45] roychri: has joined #RubyOnRails
[16:26:07] Exuma: undefined
[16:26:14] Exuma: and it casts before before_validation unfortunately
[16:26:24] dminuoso: Exuma: attributes_before_type_cast
[16:26:28] dminuoso: sorry, was looking at an old branch
[16:27:06] Exuma: this seems sort of hacky, but it would work. so theres not really another way to do this i guess?
[16:27:09] dminuoso: Exuma: but you still have to populate the form by hand
[16:27:13] Exuma: yes that part im ok iwth
[16:32:22] Exuma: hmm ok, so this is pretty good. dminuoso thanks for pointing me to attributes_before_type_cast, very helpful
[16:33:28] crst: Or any idea how one can generate the following data set for chartkick with activerecord: There's a table `bills`, each record has a number value and a date. Whenever some records share the same day, week, month (depending on range) the number values will be summed up.
[16:34:23] qyliss_: has joined #RubyOnRails
[16:34:48] dionysus69: has joined #RubyOnRails
[16:38:24] Exuma: crst: like dis...
[16:39:57] Exuma: Bill.where(created_at: @start_date.beginning_of_day..@end_date.end_of_day).sum(:amount) where `amount` is your "number value" field
[16:42:22] choke: has joined #RubyOnRails
[16:48:19] orbyt_: has joined #RubyOnRails
[16:49:17] AzaToth: has joined #RubyOnRails
[16:50:03] crst: Exuma: thanks! This needs to be encapsulated, right?
[16:50:12] desperek: has joined #RubyOnRails
[16:50:46] crst: In something which injects @start_date and @end_date to get the range
[16:53:38] crst: According to the first example at https://www.chartkick.com why can't one just do something like <%= line_chart Bill.amount.group_by_day(:created_at).count %> ?
[16:54:02] apparition: has joined #RubyOnRails
[16:54:18] dminuoso: crst: You can, but you shouldn't.
[16:55:07] crst: dminuoso: I can't. I get: undefined method `amount'
[16:55:47] dminuoso: crst: Then your `Bill` has no such thing.
[16:55:58] crst: And apart from that I have no idea how to make something better or why it's considered bad.
[16:56:28] jcarl43: has joined #RubyOnRails
[16:57:15] crst: dminuoso: It has, when doing `Bill.last.amount` I get the value
[16:58:37] apeiros: has joined #RubyOnRails
[16:59:22] choke: https://gist.github.com/jblac/6e588112921c53b79b5684597edd190f dealing with moving a legacy app to rails, and having a small issue with pundit. When I run rspec, it's telling me: unable to find scope `CompanyLocationPolicy::Scope` for `CompanyLocation` not sure what's going on here
[16:59:57] dminuoso: crst: Just because objects of type Bill respond to `amount` does not mean that `Bill` itself responds to `amount`.
[17:01:11] dminuoso: choke: Can you run with `-b` and include the full backtrace?
[17:01:20] mroutis: has joined #RubyOnRails
[17:01:58] choke: I can indeed
[17:02:35] orbyt_: has joined #RubyOnRails
[17:02:37] crst: dminuoso: Please give me another hint
[17:03:12] dminuoso: crst: I have no idea what Bill.amount.group_by(...) is supposed to do.
[17:04:10] choke: dminuoso https://gist.github.com/jblac/6e588112921c53b79b5684597edd190f just updated the gist with the backtrace
[17:04:10] crst: dminuoso: Do you have an idea what Bill.group_by(...) is supposed to do?
[17:06:37] jottr_: has joined #RubyOnRails
[17:11:19] one_zero: has joined #RubyOnRails
[17:18:15] dminuoso: crst: You are violating the rails assumptions about where Api::V1::CompanyLocationPolicy::Scope is located.
[17:18:52] dminuoso: crst: Im assuming that its trying to autoload it, but it fails because that file would need to be located in api/v1/company_location_policy/scope.rb and not what I presume to be api/v1/company_location_policy.rb
[17:19:12] crst: choke: ^
[17:20:50] dminuoso: choke: On that note you should probably eager load in your tests.
[17:22:13] espressocannon: what is the link_to for the root direcotry
[17:22:26] mroutis: espressocannon: link_to root_path ?
[17:22:39] choke: Figured it out -- my policies are namespaced ( api::v1::policynamehere ) and pundit doesn't allow for that. if i move them outside of name spacing it works fine. Though seems odd not to allow NS, 'cause authorization might be different from one version to the next... I'll have to re-think how I'm building my policies..
[17:23:27] espressocannon: I swear i googled it
[17:23:48] dminuoso: choke: actually that makes sense, the diagnostic implies this.
[17:24:09] dminuoso: choke: Im fairly sure you should be able to rig this to allow namespaces
[17:24:15] dminuoso: And then send a PR upstream =)
[17:24:51] choke: It looks like someone already did that, it got merged - then reverted
[17:25:15] dminuoso: choke: Can you link the PR?
[17:25:45] dminuoso: choke: The way I read it you can directly force this.
[17:26:14] dminuoso: choke: try defining `policy_class` on the objects CompanyLocation
[17:27:14] choke: https://github.com/varvet/pundit/pull/152. I think is the one
[17:27:33] dminuoso: choke: i.e. def self.policy_class; Api::V1::CompanyLocationPolicy; end
[17:28:55] dminuoso: Which I think is not bad, because it directly documents the policy in the object class.
[17:29:40] espressocannon: got a question about conventions: Where do you put your global partials. like top-level menus
[17:29:53] espressocannon: ie. things that are used on many different views
[17:30:50] dminuoso: espressocannon: Here I dont use views at all, and maintain a feature centric hierarchy of cells.
[17:30:51] dminuoso: espressocannon: One feature is called layout, so I have app/cells/layout/menus/topbar_cell.rb
[17:30:54] choke: dminuoso that works, but what happens in the future when I have 2 versions of the API and they both require different permissions ( likely to happen - our permissions are changing a lot right now ). I'm guessing i'd almost have to namespace my models as well?
[17:31:24] dminuoso: choke: The answer seems too trivial so I think there's some miscommunication.
[17:32:36] espressocannon: alright I don't think I've gotten to that point yet.I shouldn't even be bothering with front end right now anyways, I still gotta somehow figure out how to database
[17:32:49] espressocannon: thanks for the tipthough, ill check out this layout stuff
[17:33:05] dminuoso: choke: well let me ask differently, how would you expect this to work with automatic finders and no separate models?
[17:33:25] dminuoso: espressocannon: You can use feature based hierarchy with views too.
[17:33:46] dminuoso: espressocannon: It just means you must let go of all the pure magic naming feature and write code.
[17:34:35] espressocannon: no I like the idea of layouts
[17:34:44] KeyJoo: has joined #RubyOnRails
[17:35:19] espressocannon: But I need to get my data sorted before I start messing with the front end. I am trying to figure out how to associate my various tables.
[17:35:20] dminuoso: espressocannon: Doesn't standard rails come with a directory app/views/layout? =)
[17:35:50] espressocannon: it has application / mailer.html.erb in it
[17:35:54] dminuoso: espressocannon: Just maintain whatever directory structure you want.
[17:35:57] dminuoso: espressocannon: You can render any view from any view.
[17:36:21] dminuoso: Your app/views/user/show.html.slim can render app/views/mushroom/index.html.slim if it wants
[17:36:48] dminuoso: I think you just need to use partials because
[17:38:18] choke: I suppose I wouldn't -- great question...
[17:42:56] espressocannon: well. I think I am just used to the concept of partials because I used to build sites from scratch with html/css and php includes
[17:43:46] espressocannon: I am about 2 years into actual programming (i didn't actually use php for anything more than includes) so I am into the idea of programatically building sites
[17:43:52] espressocannon: I ust need to learn how, know what I mean
[17:44:19] espressocannon: I am now 3 days into rails, so after I figure this database out, I will jump into layouts.
[17:44:36] espressocannon: though, in the end, I will most likely be using react for my front end
[17:44:44] espressocannon: I just feel more at home with JSX
[17:49:21] Cache_Money: has joined #RubyOnRails
[17:50:18] mroutis: espressocannon: are you planning to use it as part of the framework or creating an API and a frontend?
[17:50:38] Cavallari: has joined #RubyOnRails
[17:50:46] espressocannon: yeah. in the future that's my plan with rails
[17:50:55] espressocannon: for this particular project I will be using templates
[17:51:06] espressocannon: err. that is . rails for the full stack
[17:51:15] espressocannon: or at least back-end and front-end
[17:51:47] espressocannon: but yeah, in the future I will most likely be doing an API thing with rails. unless they are little quick projects for clients
[17:52:02] riotjones: has joined #RubyOnRails
[17:52:47] espressocannon: i gotta go do a bit of work, but thanks for the tips on layouts. I am going to give it a shot later today
[17:54:59] espressocannon: oiii. it's as easy as "render json:"
[18:07:27] keegnotrub: has joined #RubyOnRails
[18:07:54] mmoll: has left #RubyOnRails: ("WeeChat 2.0.1")
[18:09:59] jnollette: has joined #RubyOnRails
[18:13:43] kies: has joined #RubyOnRails
[18:13:46] jottr_: has joined #RubyOnRails
[18:26:29] troys: has joined #RubyOnRails
[18:32:05] mostlybadfly: has joined #RubyOnRails
[18:32:37] mostlybadfly: has joined #RubyOnRails
[18:33:13] mostlybadfly: has joined #RubyOnRails
[18:33:56] mostlybadfly: has joined #RubyOnRails
[18:34:34] mostlybadfly: has joined #RubyOnRails
[18:35:34] mostlybadfly: has joined #RubyOnRails
[18:36:14] fumck: has joined #RubyOnRails
[18:36:30] mostlybadfly: has joined #RubyOnRails
[18:36:59] fcser__: has joined #RubyOnRails
[18:37:31] mostlybadfly: has joined #RubyOnRails
[18:37:37] JJonah_: has joined #RubyOnRails
[18:37:40] Kamuela_: has joined #RubyOnRails
[18:37:58] AnotherOne: has joined #RubyOnRails
[18:38:21] Puffball: has joined #RubyOnRails
[18:38:27] mostlybadfly: has joined #RubyOnRails
[18:38:29] macxim: has joined #RubyOnRails
[18:39:00] mostlybadfly: has joined #RubyOnRails
[18:39:35] mostlybadfly: has joined #RubyOnRails
[18:40:11] mostlybadfly: has joined #RubyOnRails
[18:40:42] mostlybadfly: has joined #RubyOnRails
[18:40:53] jrm2: has joined #RubyOnRails
[18:41:16] mostlybadfly: has joined #RubyOnRails
[18:41:52] mostlybadfly: has joined #RubyOnRails
[18:41:53] gs: has joined #RubyOnRails
[18:42:34] mostlybadfly: has joined #RubyOnRails
[18:43:12] mostlybadfly: has joined #RubyOnRails
[18:43:33] beingjohnm_: has joined #RubyOnRails
[18:43:40] prooftechnique_: has joined #RubyOnRails
[18:43:50] sameerynho: has joined #RubyOnRails
[18:44:34] alfiepates: has joined #RubyOnRails
[18:45:18] Sirecote: has joined #RubyOnRails
[18:45:25] Avon: has joined #RubyOnRails
[18:46:46] AntiSpamMeta: has joined #RubyOnRails
[18:46:48] mostlybadfly: has joined #RubyOnRails
[18:47:23] mostlybadfly: has joined #RubyOnRails
[18:47:59] mostlybadfly: has joined #RubyOnRails
[18:48:41] mostlybadfly: has joined #RubyOnRails
[18:49:19] mostlybadfly: has joined #RubyOnRails
[18:49:53] alfiemax: has joined #RubyOnRails
[18:50:19] mostlybadfly: has joined #RubyOnRails
[18:51:16] mostlybadfly: has joined #RubyOnRails
[18:52:18] mostlybadfly: has joined #RubyOnRails
[18:52:33] Takumo: has joined #RubyOnRails
[18:52:42] lunarkitty7: has joined #RubyOnRails
[18:53:12] mostlybadfly: has joined #RubyOnRails
[18:56:21] mostlybadfly: has joined #RubyOnRails
[18:56:56] mostlybadfly: has joined #RubyOnRails
[18:57:38] mostlybadfly: has joined #RubyOnRails
[18:58:17] mostlybadfly: has joined #RubyOnRails
[18:59:16] mostlybadfly: has joined #RubyOnRails
[19:00:13] mostlybadfly: has joined #RubyOnRails
[19:00:48] mostlybadfly: has joined #RubyOnRails
[19:01:23] mostlybadfly: has joined #RubyOnRails
[19:02:05] mostlybadfly: has joined #RubyOnRails
[19:02:45] mostlybadfly: has joined #RubyOnRails
[19:03:45] mostlybadfly: has joined #RubyOnRails
[19:04:42] mostlybadfly: has joined #RubyOnRails
[19:05:43] mostlybadfly: has joined #RubyOnRails
[19:06:38] mostlybadfly: has joined #RubyOnRails
[19:08:06] mostlybadfly: has joined #RubyOnRails
[19:09:12] mostlybadfly: has joined #RubyOnRails
[19:10:21] russt: has joined #RubyOnRails
[19:11:07] Liothen: has joined #RubyOnRails
[19:11:24] morenoh149: has joined #RubyOnRails
[19:14:13] mostlybadfly: has joined #RubyOnRails
[19:20:11] mostlybadfly: has joined #RubyOnRails
[19:25:09] mostlybadfly: has joined #RubyOnRails
[19:25:44] mostlybadfly: has joined #RubyOnRails
[19:26:08] srinidhi: has joined #RubyOnRails
[19:26:19] mostlybadfly: has joined #RubyOnRails
[19:26:54] mostlybadfly: has joined #RubyOnRails
[19:27:29] mostlybadfly: has joined #RubyOnRails
[19:28:04] mostlybadfly: has joined #RubyOnRails
[19:43:29] safetypin: has anyone heard of a gem that provides a "notebook" system?
[19:44:25] someuser: has joined #RubyOnRails
[19:45:09] Dimik: has joined #RubyOnRails
[19:54:40] havenwood: safetypin: what does that mean?
[19:55:12] safetypin: something that would let users take notes and organize them in some way.
[19:55:21] safetypin: like textual notes
[19:58:06] dionysus69: has joined #RubyOnRails
[20:02:02] mroutis: has joined #RubyOnRails
[20:04:51] morenoh149: has joined #RubyOnRails
[20:07:26] Cache_Money: has joined #RubyOnRails
[20:10:51] blackcross_: has left #RubyOnRails: ()
[20:10:51] blackcross_: has joined #RubyOnRails
[20:13:12] blackcross_: How would I join 7 different model instances into 1 object with attributes from all 7 models? Example model instance queries: https://0bin.net/paste/ASgmvWYHOTKP2B8h#D+kds8AnbD-L8fuHQttDL7eMlAGQcW3lLG3oTYRGhb/
[20:21:28] mroutis: blackcross_: did you try using "cached queries", "materialized views" ?
[20:22:07] mtkd: has joined #RubyOnRails
[20:22:18] mroutis: blackcross_: https://github.com/thoughtbot/scenic
[20:24:50] keegnotrub: has joined #RubyOnRails
[20:25:46] mroutis: blackcross_: sorry, maybe I missunderstood what you want to achieve; is it having a single variable (including everything you need) instead of separate variables?
[20:28:27] mroutis: blackcross_: if that is, read about the "decorator" pattern, you may find this useful https://github.com/drapergem/draper
[20:31:50] blackcross_: one single variable, thank you for the info
[20:32:08] jnollette: has joined #RubyOnRails
[20:36:22] mroutis: blackcross_: also, if you want something simple, with all the overhead of dealing with a "decorator", you could use an OpenStruct
[20:39:02] blackcross_: OpenStruct is a gem or something else? link?
[20:41:08] alfiemax: has joined #RubyOnRails
[20:42:19] theinquisitor: has joined #RubyOnRails
[20:43:03] havenwood: blackcross_: OpenStruct is part of the Ruby stdlib.
[20:43:16] havenwood: blackcross_: require 'ostruct'
[20:49:12] blackcross_: OpenStruct is perfect, thank you very much
[20:56:12] tycoon177: openstruct looks really neat!
[20:58:48] morenoh149: has joined #RubyOnRails
[20:58:58] Rodya_: has joined #RubyOnRails
[21:08:29] workmad3: has joined #RubyOnRails
[21:19:11] SteenJobs: has joined #RubyOnRails
[21:20:04] Cache_Money: has joined #RubyOnRails
[21:23:48] alfiemax: has joined #RubyOnRails
[21:32:00] sameerynho: has joined #RubyOnRails
[21:37:29] tfitts: has joined #RubyOnRails
[21:39:32] tfitts: is there a way to alias an entire controller, such that if I have a Pet model that I access through /pets I can also post to /dogs /cats /birds or get at the same routes
[21:48:48] kies: has joined #RubyOnRails
[21:48:57] alfiemax: has joined #RubyOnRails
[21:50:37] SteenJobs: has joined #RubyOnRails
[21:52:46] morenoh149: has joined #RubyOnRails
[21:55:13] darkhanb: has joined #RubyOnRails
[22:04:25] kapil___: has joined #RubyOnRails
[22:04:32] mroutis: has joined #RubyOnRails
[22:10:03] fryguy: `resources :pets, path: :dogs` etc.
[22:16:43] Cache_Money: has joined #RubyOnRails
[22:21:12] alfiemax: has joined #RubyOnRails
[22:26:51] sameerynho: has joined #RubyOnRails
[22:31:15] Dimik: has joined #RubyOnRails
[22:36:17] ephemer0l_: has joined #RubyOnRails
[22:41:52] alfiemax: has joined #RubyOnRails
[22:46:46] morenoh149: has joined #RubyOnRails
[22:53:01] workmad3: has joined #RubyOnRails
[22:54:34] guacamole: has joined #RubyOnRails
[23:11:15] alfiemax: has joined #RubyOnRails
[23:22:21] sameerynho: has joined #RubyOnRails
[23:23:14] tpendragon: has joined #RubyOnRails
[23:29:05] fragamus: has joined #RubyOnRails
[23:30:40] morenoh149: has joined #RubyOnRails
[23:43:48] alfiemax: has joined #RubyOnRails
[23:56:12] cnk: has joined #RubyOnRails