#RubyOnRails - 15 August 2017
« Back 1 day Forward 1 day »
[09:31:06] dionysus69: I have require rails-ujs in both of them but it only gets loaded in admin side
[09:32:26] dionysus69: here are my application.js files https://gist.github.com/anonymous/110d330d2905089b489afa40ceaabea0
[10:10:23] kitsuneyo: in minitest, is there an easy way for me to get the class name of the current test? like `this_test.class' ?
[10:39:24] Takumo: (Might not be the best place to ask but...) I'm having trouble with nested attributes in activeadmin, namely that newly created nested records aren't being saved. I've got `accepts_nested_attributes_for` in the model and I've allowed the nested records in activeadmin. Existing records update fine but new records do not get created
[10:57:22] tbuehlmann_: see http://guides.rubyonrails.org/v4.2/association_basics.html#bi-directional-associations
[11:02:04] Takumo: ok that's weird, I added :foos_attributes to ActiveAdmin's permit_params, but rails is still logging it as an unpermitted parameter
[11:05:48] Takumo: ah, sorted it, I had to write my own strong params function rather than rely on AA
[12:21:51] Dbugger: Can you guys give me a hand? When I run tests I get this output (https://hastebin.com/ocuyefeyan.bash). I have no idea what my tests do not seem to be working well with Devise. This is my repo: https://bitbucket.org/enmotent/foretale
[12:22:42] Dbugger: I added "Devise::TestHelpers" in the "test_helper.rb", and even so, I cannot seem to get them working. No idea why...
[12:23:01] hammer065: I set it up as usual, but for some reason ActionCable.server.broadcast returns nil instead of the number of clients who received it
[12:24:23] hammer065: Also: The Client is successfully connecting to the channel according to the rails log
[12:24:57] hammer065: Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
[16:06:23] et09: i have a huge query with aliased subselects and joined columns and other crap, and of course rails is trying to jam it into the model attributes...how can i get the raw sql tuples?
[16:11:10] et09: do i have to do .to_sql and then go around and do ActiveRecord::Base.connection.execute [...]
[16:12:04] et09: alternate phrasing of my question...is there an equivalent to "pluck" that returns hashes?
[16:22:49] Caerus: hello, I created new app with react and wepack enabled, will I have problems if I use bootstrap4 along react? I want to use boostrap to style most of the static content. Rails -v 5.2.1
[17:02:43] daveomcd: I'm getting an error when trying to do 'gem install json -v '1.8.3', error: https://gist.github.com/daveomcd/43cfef11a237226751274c8effa79132 -- Anyone know how i can correct this?
[18:52:46] ruby_railroad02: Hello, Im running an application on AWS EC2. DB is an RDS instance. When I inspect the db models via rails c on the EC2, I get the correct data, however, when I access through the browser I don't see the data. Using the same exact db connected to my dev envirmonent I see the correct data in rails c and in the browser when running rails s. Any thoughts as to what may be causing this? Caching? How would I troubleshoot
[19:08:00] mlt-: Uhm...how would I go about transaction isolation and rake test? It seems testing wraps everything in begin/rollback thus resulting in ActiveRecord::TransactionIsolationError because of joining existing open trasnaction
[19:10:58] matthewd: mlt-: You'd probably need to disable transactional tests for those tests, and handle the setup/cleanup yourself
[19:15:18] mlt-: matthewd: this sounds promising. Can I do it per test method? Or per entire subclass of integration test?
[19:16:07] matthewd: The latter, because it affects the setup and teardown methods. Just split your test class in two as needed.
[19:19:57] mlt-: Also I noticed that fixture_file_upload searches for a file from rails root and not from fixture_path :( I'm using Rails 4.2.7 . I thought it should look at the same location I have other fixtures for the test class
[19:23:49] mlt-: Yeah... I was not sure if it was version specific as it didn't do what documentation says:-) Oh well...
[19:34:43] mlt-: Speaking of Rails 4 vs 5, do I use xhr :get and alike in 4 while get ..., xhr: true in 5, right?
[20:05:36] mustmodify: I have an Address model. I have two other models, Customer and Appointment. I want to ensure only US locations are attached to Appointment, but I need to allow non-US addresses for Customer. So I'm thinking that validation should be on Customer, but I don't typically do remote validations. Any thoughts?
[20:09:26] matthewd: mustmodify: You'll need to consider what happens if a customer changes address after they have an appointment, for example
[20:49:38] mlt-: Is there anything wrong with huge single method for integration testing (for one specific case) with lots of actions and asserts?
[21:08:03] mustmodify: matthewd: right, that's already handled. I just need to figure out how to validate whether it's in or out of the US.
[21:10:51] mlt-: matthewd: Somehow with `self.use_transactional_fixtures = false`, I see stuff left in DB, but I still get issue with `con.transaction(isolation: :serializable) do`...
[21:11:11] mustmodify: that's what I'm thinking. I just don't typically have validations that check other models. I'm wondering if there are any gotchas that I'm not considering.
[21:18:47] mlt-: Can someone comment what is going on https://github.com/aamine/activerecord4-redshift-adapter/blob/master/test/cases/transaction_isolation_test.rb#L16 ? They turn off transactional fixtures and do expect serialized xact to fail
[21:49:17] mlt-: Uhm....is controller's before_update filter is wrapped into its own transaction (for update)?
[22:25:28] jaegerca: If I have action cable running on two servers, and a user is connected on server A, but server B broadcasts the event, how does the user get notified?