#RubyOnRails - 17 September 2018
« Back 1 day Forward 1 day »
[00:23:28] friedrubber: If I have some_object of class Arel::SelectManager, and I run 'some_object.to_sql', I get a prepared sql statement. How can one get the associated bind values from some_object?
[00:24:54] friedrubber: My goal is to get an sql statement without bind values that can be executed in postgres.
[02:22:30] i8igmac: are there any ide's i can install in my rails app to modify the current running web app
[02:27:27] i8igmac: i have been trying to make a basic example, but i fail to even produce a tree view
[02:47:59] i8igmac: i do all my coding on my android currently from ssh and nano... but this is a real struggle
[05:03:40] vedu_: [cross-post] Hello. In rspec, can I specify certain tests to be 'slow' and run them only if specified?
[10:41:27] dionysus69: I have this line in log and the fail2ban failregex, it should work as I know but it doesn't, is my failregex correct? http://paste.debian.net/1042777/
[12:44:30] vedu_: Hello. I am trying to get a simple action cable example working, but nothing is happening (no errors either). Code and logs: https://gist.github.com/vedant1811/3103d68cfd4fb5a64b3830169f1761a5
[12:45:37] apeiros_: ok, I'm too stupid - I have two local rails apps, one running on 127.0.0.1:3000, and the other on 127.0.0.1:3001. From 127.0.0.1:3001 I want to do a fetch("http://127.0.0.1:3000/api/somethings.json") in JS.
[12:46:10] apeiros_: At the moment I get "Origin http://127.0.0.1:3001 is not allowed by Access-Control-Allow-Origin"
[12:47:24] apeiros_: where do I have to add what to add this? my attempts at modifying config/initializers/content_security_policy.rb failed, as did my try to call `content_security_policy false` in the ApplicationController
[13:37:05] apeiros: I thought rails 5.2 had everything built-in already. took me a while to figure it wasn't so.
[13:39:56] apeiros: as far as I understood it, it's two different sides of the same problem. if browser on website A.com wants to fetch data from B.com, it needs CSP info on A.com, and CORS on B.com
[13:40:38] apeiros: I'm still fuzzy from which attack vectors CORS provides protection. but will read that up soon enough.
[14:28:04] dionysus69: I am tinkering with fail2ban for a while now, this rule: REJECT all -- my_ip_here 0.0.0.0/0 reject-with icmp-port-unreachable gets added to the iptables but I am still able to render login page
[19:08:02] pkayokay: When developing a Rails App, should one create controllers, models, and then integrate user authentication? or should users be created first. What would be the best approach?
[19:38:23] beingjohnm: and, if you're starting from scratch, writing tests before writing any methods
[20:30:54] samscam7: im having an issue with this tutorial im doing and was wondering i anyone would be able to help me
[20:42:32] baweaver: samscam7: Linking to the tutorial and explaining your issue will be much more likely to get answers.
[20:43:14] samscam7: ik i just wanted to see if there was anyone online before typing out a whole explanation
[20:43:42] samscam7: essentially the project is a website where developers and investors can meet and wtvr. one of the things is that theres a basic subscription and a pro subscription. my problem is that when i try to make a test account on the pro subscrition i get an error that says "plan must exist" and i have no idea why it doesnt
[20:45:34] samscam7: https://github.com/99Probl3ms/c9/blob/user_auth/app/controllers/users/registrations_controller.rb
[20:49:22] baweaver: (note that I have a meeting in a few minutes, so may take a bit to answer, just wanted to put that out there)
[22:14:31] patrick99e99: rel = MyTable.select(:col1, :col2); rel.count => ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR: function count(integer, character varying) does not exist
[22:29:55] i8igmac: are there any working examples of rails and jstree for displaying a recursive directory structure
[22:57:58] davidh38: hey guys,i am new here. i have created a new model in rails with @myuser = Mymodel.new(name: 'Max')
[22:59:03] davidh38: the problem i face, if i print it out, i cannot see the 'name' field, only 'created_at'
[23:27:17] davidh38: @baweaver i print the model, i think i found the mistake. If i generate a model, i have to add my custom fields in my "rake" command
[23:28:41] patrick99e99: baweaver: yeah I get it, but it just sucks.. I have a db table with millions of rows, and one column is json with lots of stuff, so there are issues where servers crash from running out of memory, and to get around this, I added select in some cases so that the serialization of those rows don't include those json columns.. but anywhere that was previously doing .count on the relation blows up unless I do .to_a on it first,
[23:30:27] baweaver: If you're just trying to get a count of all rows, it should just give a scan of the count of rows
[23:30:50] baweaver: You could always throw a `explain` on the end of it to see what shenanigans may be going on
[23:35:23] baweaver: You can set a break point right before the save and see what context there is around it that might be causing you pain
[23:36:04] davidh38: @baweaver thanks for offering help, i appreciate that. it worked with rails g migration AddFieldsToMymodel name:string
[23:37:13] baweaver: samscam7: half the time I stick a `binding.pry` somewhere, look around, and the issue becomes real clear real quick
[23:37:29] davidh38: @baweaver i started out with a youtube video https://www.youtube.com/watch?v=pPy0GQJLZUM
[23:37:58] davidh38: it helped me, but i am still missing some basics i think. Would you recommend something?
[23:41:35] davidh38: @baweaver i just want to do simple things, writing and reading to a database, using bootstrap maybe and calling restapis and use this data
[23:47:48] davidh38: @baweaver i think i will be going through this: https://www.railstutorial.org . Looks awesome, thank you