jatwell93 / rubyproject

1 stars 1 forks source link

User table not found #28

Closed Mirv closed 7 years ago

Mirv commented 7 years ago

Did a `git pull origin' to my c9 ide & started server up, can't login.

Probably slipped through because our lack of testsuite ... not even sure where to start on this one as when I checked schema.rb it's clearly there ... routing issue?

ActiveRecord::StatementInvalid in UsersController#show
Could not find table 'users'

Extracted source (around line #66):

  private
    def set_user
      @user = User.find(params[:id])
    end

    def user_params
jatwell93 commented 7 years ago

i thought it might have to do with devise routes needing to be at the top which i read on SO but didnt seem to work >.<

jatwell93 commented 7 years ago

@Mirv are you still having this error?

Mirv commented 7 years ago

I wasn't sure what going to Japan was in reference to so I figured you were on internship or something over there - I've been brushing up my testing & job hunting - haven't poked this codebase.

Just now, I tried moving the devise header around some in routes & got slightly different error - so I popped into the rails console & did ...

$ User.all

ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: users: SELECT "users".* FROM "users"

I then tried getting into the rails console production - which failed with unusual error - regardless the issue must lie deeper than just a route issue.

jatwell93 commented 7 years ago

hahahah whoops my bad that was a bit vague. Just holiday. But back at it now. hope the job hunts going well btw

wow the errors keep on coming, haha. So strange i just tried that and got

User.all
  User Load (14.8ms)  SELECT "users".* FROM "users"
  User Load (14.8ms)  SELECT "users".* FROM "users"
 => #<ActiveRecord::Relation [#<User id: 1, username: "MTest", email: "tester@test.com", created_at: "2017-05-03 06:21:34", updated_at: "2017-05-03 14:22:53", first_name: "Matt", last_name: "Test", admin: false, provider: nil, uid: nil>, #<User id: 2, username: "1MTest", email: "tester1@test.com", created_at: "2017-05-03 06:21:34", updated_at: "2017-05-03 06:21:34", first_name: "1SteveBob", last_name: "1Test", admin: false, provider: nil, uid: nil>, #<User id: 3, username: "2MTest", email: "tester2@test.com", created_at: "2017-05-03 06:21:35", updated_at: "2017-05-03 06:21:35", first_name: "2SteveBob", last_name: "2Test", admin: false, provider: nil, uid: nil>, #<User id: 4, username: "3MTest", email: "tester3@test.com", created_at: "2017-05-03 06:21:35", updated_at: "2017-05-03 06:21:35", first_name: "3SteveBob", last_name: "3Test", admin: false, provider: nil, uid: nil>, #<User id: 5, username: "Jatwell", email: "atwellj93@gmail.com", created_at: "2017-05-03 06:33:19", updated_at: "2017-05-03 06:38:29", first_name: "Josh", last_name: "Atwell", admin: false, provider: nil, uid: nil>, #<User id: 6, username: "murky", email: "tester222@test.com", created_at: "2017-05-03 14:56:40", updated_at: "2017-05-03 14:56:40", first_name: "etst", last_name: "test", admin: false, provider: nil, uid: nil>, #<User id: 7, username: "A&K Labs", email: "atwellj94@gmail.com", created_at: "2017-05-10 06:19:44", updated_at: "2017-05-10 06:19:53", first_name: "A&K Labs", last_name: nil, admin: false, provider: nil, uid: nil>]> 
2.3.0 :002 > 

So it spatout all the users at my end.

Mirv commented 7 years ago

LoL ... found the problem ... I did a pull request & apparent the repository schema is getting blown out ... for me, I had to get copy of the schema & paste it into the schema.rb, then tell rails to rake db:schema:load.

Mirv commented 7 years ago

Yea - that's my test data from when I worked on your c9 account poking around - apologies - it wasn't isolated, hadn't realized that you weren't branching :(

jatwell93 commented 7 years ago

Well at least its one problem down haha.

hmmm i thought i'd been branching since that initial mishap not sure what happened there, sorry about that.

Mirv commented 7 years ago

I'm relatively sure it's my fault for not asking earlier...so the next trick is workflow, if you're pushing a fix, make sure to get it uploaded & update me here - so I can then pull your update.

jatwell93 commented 7 years ago

ahhhh ok that makes sense! I will let you know each time i push a commit?

Mirv commented 7 years ago

Normally, when I sit down to start coding I'll do a pull/fetch (personal preference as one is less work the other shows me all the changes before merging). Since I'm already putzing around - I'd probably miss that update. Perhaps it wouldn't be a bad idea to communicate when we push - but not sure of a way that wouldn't be redundant...the issues seem to be pretty good as they show up blue on my upper right corner.

Mirv commented 7 years ago

I just saw you're online in the shared c9 space, sent a test message via the collaboration tab on the far right.

jatwell93 commented 7 years ago

Sounds good to me. Next time i push i'll leave a little 'pushed' message on here