BradenBraden

Activity Graph

Page 1 of 1

2016-03-15

[13:05:23] BradenBraden: has joined #RubyOnRails
[15:12:45] BradenBraden: Quit: Leaving

2016-03-03

[13:11:50] BradenBraden: has joined #RubyOnRails
[13:14:08] BradenBraden: hows it hanging?
[13:41:49] BradenBraden: imo you are asking the server for its timezone. that wont change based on where the user is
[13:42:32] BradenBraden: you'd prob need some JS magic to change that
[14:00:44] BradenBraden: im working on a little example project which aims to completely decouple a rails project from any frontend or backend (db) using various patterns which Uncle Bob talks about. The whole Clean Architecture thing.
[14:01:07] BradenBraden: i have gotten some progress done. but its getting tough now when trying to deal with associations.
[14:02:08] BradenBraden: i have custom Entity objects which represent the data for the datasource, custom Validators, Repositories (using the Repository Pattern mostly here), UseCases etc
[14:03:38] BradenBraden: anyone interested in taking a look at the project as it is so far? (still got a long way to go) https://github.com/brazenbraden/twitter-repository-example
[14:06:48] BradenBraden: timmmaaaayyy, looks like unicorn gem isnt installed in your working environment
[14:07:42] BradenBraden: why are you starting unicorn like that anyway?
[14:08:00] BradenBraden: unicorn -c /app/config/unicorn.rb -p 3000 -E development
[14:08:00] BradenBraden: cd into the directory where the project is and run something along the lines of
[14:09:40] BradenBraden: timmmaaaayyy, you should take a look at the "god" gem. its been a life safer for me (and you can use those commands with it too)
[14:10:37] BradenBraden: timmmaaaayyy, i dont restart unicorn lol. if something goes wrong, i let god look after it :P
[14:11:19] BradenBraden: timmmaaaayyy, https://gist.github.com/brazenbraden/f278739009d304b71016
[14:15:01] BradenBraden: you gotta love gem names
[14:32:00] BradenBraden: why? its brings life to things, and when they die, it resurrects them.
[14:34:06] BradenBraden: goddess implies female. what happens when a female tries to do something as simple as reverse park? xD
[14:34:15] BradenBraden: factorygirl is taken
[14:35:12] BradenBraden: not saying all, just thats the stereotype :P
[14:35:29] BradenBraden: Overseer would be a good alternative
[14:36:15] BradenBraden: cos that would just be confusing
[14:37:57] BradenBraden: nocontrol, it should ignore the files if they already exist
[14:38:38] BradenBraden: oh wait, missed the word "test" lol
[14:47:25] BradenBraden: ferr, you can manipulate them in your controller (not very good) or you can use a decorator
[14:52:46] BradenBraden: throw us a gist?
[14:58:29] BradenBraden: ferr, so this is meant to be used when retrieving a record?
[14:59:56] BradenBraden: ferr, would 'after_find' be more appropriate?
[15:02:46] BradenBraden: dunno.. could it be a problem with lazy loading?
[15:04:28] BradenBraden: honestly i cant make heads or tails of your query lol
[15:05:23] BradenBraden: never seen anything like *_assoceable before
[15:07:36] BradenBraden: that could be a problem (unless they getting more than they should, then thats a win :P)
[17:01:51] BradenBraden: thats uncle bob's way
[21:53:00] BradenBraden: Quit: Leaving

2016-02-15

[09:10:43] BradenBraden: has joined #RubyOnRails
[09:12:36] BradenBraden: not load database configuration. No such file - ["config/database.yml"]. What have I missed?
[09:12:36] BradenBraden: hi guys. so i have a rails project that was set to use postgres but switching it over to rethinkDB to give it a go. removed the database.yml file, not require active_record in application.rb, removed migration files and all references to active record the in environment files as well as the models, however, its still loading AR and looking for database.yml which it no longer finds. Cannot load `Rails.application.database_configuration`: Could
[10:09:25] BradenBraden: i have removed everything except for the bare bones app but still get "Could not load database configuration. No such file - ["config/database.yml"]". Cant find any other reference to active record so dont know why it is loading up.
[10:15:15] BradenBraden: stack trace. what other info would be helpful? https://gist.github.com/brazenbraden/d592602dd40dbb65f63f
[10:18:03] BradenBraden: added application.rb and unicorn.rb
[10:22:00] BradenBraden: universa1, doing it now. converted over a different app a couple days ago and all went fine. been using that one as a reference and as far as i can tell, done everything I did there (although the current app is much larger with a whole host of extra gems)
[10:23:04] BradenBraden: universa1, thats what im thinking
[10:23:55] BradenBraden: universa1, just the rails gem
[10:27:41] BradenBraden: if you dont include the rails gem, you dont get any of the other active_**s, plus, generating a new app with rails new app -0 includes the rails gem in the gemfile so yea, it should be there
[10:34:46] BradenBraden: matthewd, sure, but even if the gem is installed, it should matter if it is not required in the project, so by disabling 'require "active_record"', it should be loaded.
[19:03:18] BradenBraden: finally found the thorn in my side. gem 'whisper' causes the AR to boot up looking for database.yml
[19:44:42] BradenBraden: Quit: Leaving

2016-02-09

[06:12:05] BradenBraden: has joined #RubyOnRails
[08:00:02] BradenBraden: Quit: Leaving

2016-02-05

[10:15:42] BradenBraden: has joined #RubyOnRails
[14:43:14] BradenBraden: Quit: Leaving

2016-01-15

[03:26:40] BradenBraden: has joined #RubyOnRails
[13:05:56] BradenBraden: has joined #RubyOnRails
[13:21:44] BradenBraden: has left #RubyOnRails: ("Leaving")

2016-01-11

[10:59:54] BradenBraden: has joined #RubyOnRails
[16:42:03] BradenBraden: Ping timeout: 250 seconds
[18:59:11] BradenBraden: has joined #RubyOnRails
[18:59:25] BradenBraden: Read error: Connection reset by peer

2016-01-10

[21:59:14] BradenBraden: Quit: Leaving

2016-01-09

[13:33:27] BradenBraden: has joined #RubyOnRails
[16:11:13] BradenBraden: Quit: Leaving
[17:20:23] BradenBraden: has joined #RubyOnRails
[18:28:33] BradenBraden: Quit: Leaving
[18:35:29] BradenBraden: has joined #RubyOnRails
[20:48:56] BradenBraden: Ping timeout: 246 seconds
[21:04:05] BradenBraden: has joined #RubyOnRails

2016-01-07

[07:20:57] BradenBraden: has joined #RubyOnRails
[07:36:36] BradenBraden: so here is a weird one, I have built my own little login system and use the session to store a hash. I am trying to access the session from the index action but it is empty but dumping it in the view shows it is there. am I up against some sort of race condition? https://gist.github.com/brazenbraden/d2e1170044a1ef1135c7
[07:38:31] BradenBraden: seanhandley, im not, just a hash key which I retrieve from the session then use it to load the user details
[07:39:50] BradenBraden: in the index action where that bit is commented out. trying to get the current_user. if I break in the index action and use Better Errors repl to check the session, it comes back as {}
[07:41:02] BradenBraden: sevenseacat, thats what I feel, but I cant access it
[07:43:10] BradenBraden: sevenseacat, when I print out current_user in the index action (via BE repl), it returns a string saying "<html><body>You are being <a href=\"http://10.0.0.51:3000/login\">redirected</a>.</body></html>"
[07:43:58] BradenBraden: ok.. still cant see whats in it though via the repl
[07:45:21] BradenBraden: not subdomains, just paths
[07:46:07] BradenBraden: I have a lib class that handles log in and returns an object containing a hash key which I then save into the session in the login method in app_controller
[07:46:36] BradenBraden: then I misunderstood
[07:46:49] BradenBraden: its a SHA512 hash generated on timestamp
[07:46:54] BradenBraden: i can add the lib folder
[07:48:11] BradenBraden: but ive answered it. session[:user] defined in login function. contains a sha512 hash which is returned from a lib method elsewhere that talks to an external API
[07:48:58] BradenBraden: SHA512 hash. string. number and letters.
[07:49:27] BradenBraden: session_key: Digest::SHA2.new(512).hexdigest(Date.today.to_time.to_i.to_s)
[15:04:40] BradenBraden: Quit: Leaving

2016-01-05

[07:50:34] BradenBraden: has joined #RubyOnRails
[15:05:03] BradenBraden: Quit: Leaving

2015-11-18

[00:40:10] BradenBraden: Quit: Leaving

2015-11-17

[20:22:47] BradenBraden: has joined #RubyOnRails
[20:23:41] BradenBraden: is it possible to do something like a before_filter in a helper? i want to prevent certain helper functions getting called if RAILS_ENV = dev.
[20:26:27] BradenBraden: tubbo, so cant just do it for the entire helper module. i have a lot of mixpanel tracking calls in a mixpanel helper and i dont want to trigger them when in dev at all, but also think putting that into every method is a bit over the top.
[20:28:27] BradenBraden: tubbo, i see. alrighty then. thanks

2015-11-11

[14:16:10] BradenBraden: has joined #RubyOnRails
[14:19:41] BradenBraden: i are a little stuck. when i login with devise, it automatically redirects me to /users/null (for some reason) and i have used the code from the devise wiki to override the 'after_sign_in_path_for' path to redirect to root_path in my application_controller but alas, no cigar. always back to /users/null.... and why null? i dont have a users controller in my main_app. could that be the problem?
[14:22:25] BradenBraden: i've also tried creating a registrations_controller which inherits from devise::registrationscontroller and put it in there (saw that on the devise wiki too) but still no result
[14:34:48] BradenBraden: nevermind. i are a nooblet
[15:11:44] BradenBraden: Quit: Leaving

2015-11-05

[13:17:33] BradenBraden: has joined #RubyOnRails
[13:31:01] BradenBraden: i have been looking into testing my engines and from what i can tell, the spec files want to be in the main_app directory (correct me if im wrong) so this lead me to the gem combustion which apparently makes it easy to test engines and allows all the tests to be inside of the engine itself. now I doubt gems like devise and such have done this for their tests so question, what is the best way to write tests for an engine in an engine?
[15:36:52] BradenBraden: Quit: Leaving
[16:11:22] BradenBraden: has joined #RubyOnRails
[16:12:45] BradenBraden: using haml as my template rendering engine. when running my rspec with capybara tests, it fails to visit a page because it cant find the template and its only looking for ERB. how do I tell my dummy app to use haml? (i have it as a dependency in my gemspec already)
[16:13:38] BradenBraden: tubbo, trying to put those days behind me
[16:13:51] BradenBraden: YOLO dev had its place.. time to move forwards
[16:14:27] BradenBraden: tubbo, "yea"... a mountable engine
[16:14:38] BradenBraden: guess that is a gem
[16:15:18] BradenBraden: tubbo, the dummy app by default doesnt have a Gemfile
[16:16:03] BradenBraden: will give that a go
[16:16:34] BradenBraden: tubbo, that seems to have done the job :)
[16:17:13] BradenBraden: heres a minor question.. whats better, doing all the 'require "active_record/railties"' etc etc or just 'require "rails/all"' ?
[16:21:49] BradenBraden: so tubbo, how things been? (i've been absent for quite a while)
[16:22:17] BradenBraden: then im glad i havent missed anything :P
[16:24:13] BradenBraden: messine, shouldnt you just leave that up to your model? thats what its their for
[16:25:03] BradenBraden: tubbo, yea i figured that was the only difference. i was just lazy and had rails/all instead of the 5 other lines of code to require the shitz needed
[16:27:27] BradenBraden: ah its nice to be weekend
[16:30:38] BradenBraden: messine, submission only happens once at the end. you looking for javascript validations?
[16:32:29] BradenBraden: controllers (unless you talking angular) are server-side. javascript client side. if you want one of those things like password strength that auto updates on typing, then javascript. upon submitting to your controller, that will pass along to the model and ensure the input validates
[16:35:11] BradenBraden: messine, you can obviously replicate your validation in JS if you want dynamic updates based on a users input, and then rely on the model to re-validate before saving but that seems a bit excessive imo. i'd just allow them to do whatever, submit the form, and if it fails, respond with the error of why it failed. but each to their own eh
[16:41:13] BradenBraden: messine, rails (php, java, python) all operate upon the same ideas. you show your users a view. they do something and send the info to the server. the server works on it and sends it back. general flow. adding javascript doesnt bring your app into the 23rd centuary. JS is powerful but is mostly used for eye-candy (things like jQuery UI).
[16:42:01] BradenBraden: messine, its not the only way. you can do it via JS but that is not robust. JS is available to the user. they can just Inspect Element and change your validations making them null and void. The core validations happen on the server
[16:43:50] BradenBraden: messine, fair enough.
[16:45:03] BradenBraden: messine, no probs :)
[19:49:24] BradenBraden: Quit: Leaving

2015-11-04

[12:58:59] BradenBraden: has joined #RubyOnRails
[20:25:34] BradenBraden: Quit: Leaving