Page 1 of 1
[08:30:34] zvive: I'm setting up a migration that belongs to a student on student_id in the table, but which actually points at users.id --- would I just to t.references :student, index: true, than add_foreign_key :student, :users, column: user_id ?
[09:33:35] zvive: this is more of a logic question.. but say you have users... and you have teachers, students, parents, and children that all are users.. I currently have a self-referential thing setup matching teachers/students, and parents/children - but wouldn't it be more 'dry' or make sense to just create a relationship with maybe a main_id sub_id type (parent, teacher) where the sub would then be a child or student depending on type?
[09:43:21] zvive: this is more of a logic question (rails) .. but say you have users... and you have teachers, students, parents, and children that all are users.. I currently have a self-referential thing setup matching teachers/students, and parents/children - via has_many :through via 2 different models. would it be more 'dry' or make more sense to just create a relationship with maybe a main_id sub_id type (parent, teacher) where the sub would then be a child or student dep
[09:43:22] zvive: ending on type, then I could just have a method to get relationships based on type..?
[09:47:59] zvive: debugger is not compatible with Ruby 2.0 or greater...what version of ruby are you running?
[09:49:45] zvive: https://github.com/cldwalker/debugger -- you can replace with byebug it's only needed if you're using it for debugging in the code.. really. Are you upgrading an older app to rails 4/ruby2? Or creating a new rails app?
[08:35:06] zvive: Hey -- I'm building app w/ angular front/rails back.. -- and We just want to throw a up a landing page for visitors, and route all other pages through /dev/path -- and then just when we go live remove the dev namespace.. so I tried doing namespace :dev do root to: "home#index" but that's looking for dev/home_controller action index I believe...that's how I read the error....but I want just to root to the main home_controller/index method.
[08:50:52] zvive: nvm figured it out... changed the landing just to get "/" to: "home#landing" then put root to inside of a scope, and that matches up nicely so I can swap out when done without too many changes.
[08:29:56] zvive: hey I have a question... say you're using console to test the Model -- so you're just wanting to run User.create(...) -- how would you do that since attr_accessible is removed?
[08:34:39] zvive: I'm getting unknown attribute for password, --- password isn't actually a value in db, it's just something the model uses, runs through the encrypt_password method before saving the object in the db.
[08:39:29] zvive: oh, well that's confusing lol got it.. one's for grabbing the other's for putting.
[08:03:10] zvive: Say I want to tie two users together as husband/wife for instance... would I do something like this: belongs_to :spouse, :class_name => 'User', :foreign_key => :spouse_id ?
[08:04:59] zvive: Well, it's a wedding app... I could just join everything on the wedding event, so that the wedding joins both spouses but if they marry later on, they would be tied to the other spouse through another wedding event.
[06:43:10] zvive: Wouldn't it be better to do a Payments table w/ a date, then just search for last payment or payment that matches the user and sort by date?
[10:17:21] zvive: hey any1 know if possible to run migrations without restarting nginx --was getting pending migration error, but apparently it was just nginx needing a reload, but that's annoying to reload everytime.
[10:23:07] zvive: did that, kept getting db migration error. Till I did sudo service nginx restart -- think I'm gonna just create an alias to do something like RAILS_ENV=development bundle exec rake db:migrate && sudo service nginx restart
[10:24:15] zvive: I use nginx/passenger locally-- my goal was not to have to run rails s in command line, and just have it load/work w/out reload.. kinda like my laravel/php setup, been a year or two since I did a rails app, but wanting to get rails dev position, so working on a demo project for employers to view.
[11:10:52] zvive: anyone know if dotenv gem can be used without reloading my server? changes don't take effect till I reload nginx.
[11:34:58] zvive: rvanlieshout -- yeah I turned nginx off completely and instead of test.dev loaded: 0.0.0.0:3000 and changed something in .env reloaded and no change.
[11:39:00] zvive: I've tried dotenv and figaro for env vars... put Dotenv::Railtie.load in application.rb - under Bundler.. etc..
[11:46:40] zvive: eh, not too often, lol but I just hate restarting things when I want to test something out like an API and throw in an APIkey. so I'll spend 4 hours configuring crap to save like 5 minutes here and there lol
[11:49:41] zvive: yeah was thinking of just symlinking ~/.profile to my project and using inotify to just source it if I re-save new vars.
[11:59:48] zvive: I'll look into that, just used to a diff workflow in Laravel, trying to maximize my environment before I get down and dirty in code. :) decided to just link .profile to the app dir., and put export VAR... then source .profile that's so far the easiest method.