Bergrebell / CyberCoach

1 stars 1 forks source link

Boxing CRUD + Views #41

Closed wanze closed 9 years ago

svetakrasikova commented 9 years ago

@wanze Stefan, you can create running sessions, can't you? I just tried and it does not work. Just get 'Unable to create Running session' all the time.

wanze commented 9 years ago

There is a problem with the database schema and the timestamps, I had the same yesterday. Try running bin/rake db:reset RAILS_ENV=development.

Modifying the schema.rb file directly causes strange errors, for each migration (adding new table, modifying table structure etc.) we must create a migration script. Otherwise when executing db:migrate, rails does mess up the schema.

See: http://guides.rubyonrails.org/migrations.html

Note: By creating a new model, rails creates the migration file automatically :)

Does it work?

svetakrasikova commented 9 years ago

Still not working after bin/rake db:reset RAILS_ENV=development :( Did it work for you yesterday?

4 Nov 2014, в 16:20, Stefan Wanzenried notifications@github.com написал(а):

There is a problem with the database schema and the timestamps, I had the same yesterday. Try running bin/rake db:reset RAILS_ENV=development.

Modifying the schema.rb file directly causes strange errors, for each migration (adding new table, modifying table structer etc.) we must create a migration script. Otherwise when executing db:migrate, rails does mess up the schema.

Does it work?

— Reply to this email directly or view it on GitHub.

wanze commented 9 years ago

Yep after resetting the db. Is your schema.rb modified locally? This was happening in my case. If so, you should reset it to the latest commit... If still nothing works, you could try to clone the current dev branch in another directory and start there, maybe it works with a fresh copy?

svetakrasikova commented 9 years ago

The only thing that helped was to copy of the dev branch into a new directory. It's ok now. Thanks!

4 Nov 2014, в 18:32, Stefan Wanzenried notifications@github.com написал(а):

Yep after resetting the db. Is your schema.rb modified locally? This was happening in my case. If so, you should reset it to the latest commit... If still nothing works, you could try to clone the current dev branch in another directory and start there, maybe it works with a fresh copy?

— Reply to this email directly or view it on GitHub.

svetakrasikova commented 9 years ago

Hi Stefan, a couple of more things I wanted to discuss:

  1. So we list all sessions of the user on the sport sessions index page. Do we want only sport sessions of this user, or also the sessions where the user is the participant. Probably, both? Where else should the sessions where the user participates (which he did not create) go?
  2. When showing a sport session, we want to display all the 'static' fields (filled out on creation) and the fields added after completion and stored in RunningDetails, etc. if there are any already. Right?
wanze commented 9 years ago

Hi Sveta,

  1. I think it makes sense to display both, sessions the user created and participated. We could highlight the rows somehow where the user created the sessions.
  2. I think for the listing it makes sense to only display the details that are stored on our side, so that we don't need to fetch them from CyberCoach. Currently we only have the Sport type + Participating users in our DB. I guess we should also store at least the event date on our side. When viewing the details of a session, we can fetch all additional stuff from CyberCoach. What do you think?
svetakrasikova commented 9 years ago

Hi Stefan,thank you, this sounds good to me. Right, date (and maybe location) is what we could use for the listing from the cc. Btw, sorry if I am asking about stuff we've already discussed :)

Îòïðàâëåíî ñ iPhone

7 íîÿá. 2014 ã., â 15:36, Stefan Wanzenried notifications@github.com íàïèñàë(à):

Hi Sveta,

I think it makes sense to display both, sessions the user created and participated. We could highlight the rows somehow where the user created the sessions.

I think for the listing it makes sense to only display the details that are stored on our side, so that we don't need to fetch them from CyberCoach. Currently we only have the Sport type + Participating users in our DB. I guess we should also store at least the event date on our side. When viewing the details of a session, we can fetch all additional stuff from CyberCoach. What do you think?

— Reply to this email directly or view it on GitHub.

Bergrebell commented 9 years ago

Hi you two, today I finished the Form for Boxing and Cycling and added a dropdown box for selecting the different sports. But there is a minor problem with Boxing - the Field for "Numberofrounds" isn't writing anything into the DB...could sombody help me to figure out why?

lexruee commented 9 years ago

@Bergrebell Is it related to the Facade::SportSession? If so, can you push it on a separate branch?

The corresponding input text field should look like this:

<input type="text" name="number_of_rounds" id="number_of_rounds">
lexruee commented 9 years ago

So, I had a look in the entry adapter. There is a typo.

Line 26 in lib/rest_adapter/models/entry.rb must be changed as follows:

:round_duration => :round_duration,

to

:roundduration => :round_duration,

See issue #52 .

svetakrasikova commented 9 years ago

Hi, I had the boxing done already, but never got to pushing it, never mind, had the same problem with the number of rounds:) do we need to show this field btw? Round duration makes some sense, but number of rounds is stupid (what is it, maximum number? there's event duration already). I feel like a wreck, finally got everybody to bed and can't keep my eyes open myself. Will try to get something done tomorrow morning.

Îòïðàâëåíî ñ iPhone

8 íîÿá. 2014 ã., â 17:13, Bergrebell notifications@github.com íàïèñàë(à):

Hi you two, today I finished the Form for Boxing and Cycling and added a dropdown box for selecting the different sports. But there is a minor problem with Boxing - the Field for "Numberofrounds" isn't writing anything into the DB...could sombody help me to figure out why?

— Reply to this email directly or view it on GitHub.

lexruee commented 9 years ago

@Bergrebell Regarding to the number of rounds problem. I cannot reproduce this error :-).

@svetakrasikova http://localhost:3000/boxings/X/edit is not working. Maybe something that you could fix?

svetakrasikova commented 9 years ago

Yes, I'll have a look tonight. I've done that, + some other changes in the branch sports_crud

Bergrebell commented 9 years ago

@lexruee - now it seems to work! thanks!