From cd1fabe40ca4d290df33a2590f3a1f2072103972 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Thu, 20 Feb 2014 17:13:51 -0500 Subject: fix datatype names in generate.sh --- app/controllers/alerts_controller.rb | 2 +- app/controllers/matches_controller.rb | 2 +- app/controllers/pms_controller.rb | 2 +- app/models/alert.rb | 1 + app/models/match.rb | 1 + app/models/pm.rb | 2 ++ app/models/team_match_pair.rb | 2 ++ app/models/user_team_pair.rb | 2 ++ app/views/alerts/_form.html.erb | 4 ++-- app/views/alerts/index.json.jbuilder | 2 +- app/views/alerts/show.json.jbuilder | 2 +- app/views/matches/_form.html.erb | 4 ++-- app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.json.jbuilder | 2 +- app/views/pms/_form.html.erb | 8 ++++---- app/views/pms/index.json.jbuilder | 2 +- app/views/pms/show.json.jbuilder | 2 +- app/views/users/_form.html.erb | 4 ++-- 18 files changed, 27 insertions(+), 19 deletions(-) (limited to 'app') diff --git a/app/controllers/alerts_controller.rb b/app/controllers/alerts_controller.rb index e6158f4..873e9b7 100644 --- a/app/controllers/alerts_controller.rb +++ b/app/controllers/alerts_controller.rb @@ -69,6 +69,6 @@ class AlertsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def alert_params - params.require(:alert).permit(:author, :message) + params.require(:alert).permit(:author_id, :message) end end diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index bb2a67a..e9f3c5a 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -69,6 +69,6 @@ class MatchesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def match_params - params.require(:match).permit(:tournament) + params.require(:match).permit(:tournament_id) end end diff --git a/app/controllers/pms_controller.rb b/app/controllers/pms_controller.rb index 6eb94f9..5dd0d69 100644 --- a/app/controllers/pms_controller.rb +++ b/app/controllers/pms_controller.rb @@ -69,6 +69,6 @@ class PmsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def pm_params - params.require(:pm).permit(:author, :recipient, :message) + params.require(:pm).permit(:author_id, :recipient_id, :message) end end diff --git a/app/models/alert.rb b/app/models/alert.rb index e61a702..343c269 100644 --- a/app/models/alert.rb +++ b/app/models/alert.rb @@ -1,2 +1,3 @@ class Alert < ActiveRecord::Base + belongs_to :author end diff --git a/app/models/match.rb b/app/models/match.rb index 0836114..533435a 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -1,2 +1,3 @@ class Match < ActiveRecord::Base + belongs_to :tournament end diff --git a/app/models/pm.rb b/app/models/pm.rb index 24d6eb4..ab5af3b 100644 --- a/app/models/pm.rb +++ b/app/models/pm.rb @@ -1,2 +1,4 @@ class Pm < ActiveRecord::Base + belongs_to :author + belongs_to :recipient end diff --git a/app/models/team_match_pair.rb b/app/models/team_match_pair.rb index 24a4e86..85f8eaa 100644 --- a/app/models/team_match_pair.rb +++ b/app/models/team_match_pair.rb @@ -1,2 +1,4 @@ class TeamMatchPair < ActiveRecord::Base + belongs_to :team + belongs_to :match end diff --git a/app/models/user_team_pair.rb b/app/models/user_team_pair.rb index 7694996..c55dc2e 100644 --- a/app/models/user_team_pair.rb +++ b/app/models/user_team_pair.rb @@ -1,2 +1,4 @@ class UserTeamPair < ActiveRecord::Base + belongs_to :user + belongs_to :team end diff --git a/app/views/alerts/_form.html.erb b/app/views/alerts/_form.html.erb index f0da996..b60eaf2 100644 --- a/app/views/alerts/_form.html.erb +++ b/app/views/alerts/_form.html.erb @@ -12,8 +12,8 @@ <% end %>
- <%= f.label :author %>
- <%= f.text_field :author %> + <%= f.label :author_id %>
+ <%= f.text_field :author_id %>
<%= f.label :message %>
diff --git a/app/views/alerts/index.json.jbuilder b/app/views/alerts/index.json.jbuilder index 685157e..0911a5c 100644 --- a/app/views/alerts/index.json.jbuilder +++ b/app/views/alerts/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@alerts) do |alert| - json.extract! alert, :id, :author, :message + json.extract! alert, :id, :author_id, :message json.url alert_url(alert, format: :json) end diff --git a/app/views/alerts/show.json.jbuilder b/app/views/alerts/show.json.jbuilder index 83fe24a..95481eb 100644 --- a/app/views/alerts/show.json.jbuilder +++ b/app/views/alerts/show.json.jbuilder @@ -1 +1 @@ -json.extract! @alert, :id, :author, :message, :created_at, :updated_at +json.extract! @alert, :id, :author_id, :message, :created_at, :updated_at diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index 7d0a371..34494c3 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -12,8 +12,8 @@ <% end %>
- <%= f.label :tournament %>
- <%= f.text_field :tournament %> + <%= f.label :tournament_id %>
+ <%= f.text_field :tournament_id %>
<%= f.submit %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 0839c83..c8ada7a 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :tournament + json.extract! match, :id, :tournament_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index a381f65..2e45395 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament, :created_at, :updated_at +json.extract! @match, :id, :tournament_id, :created_at, :updated_at diff --git a/app/views/pms/_form.html.erb b/app/views/pms/_form.html.erb index bbc6aee..480e308 100644 --- a/app/views/pms/_form.html.erb +++ b/app/views/pms/_form.html.erb @@ -12,12 +12,12 @@ <% end %>
- <%= f.label :author %>
- <%= f.text_field :author %> + <%= f.label :author_id %>
+ <%= f.text_field :author_id %>
- <%= f.label :recipient %>
- <%= f.text_field :recipient %> + <%= f.label :recipient_id %>
+ <%= f.text_field :recipient_id %>
<%= f.label :message %>
diff --git a/app/views/pms/index.json.jbuilder b/app/views/pms/index.json.jbuilder index aebdc08..fcfca84 100644 --- a/app/views/pms/index.json.jbuilder +++ b/app/views/pms/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@pms) do |pm| - json.extract! pm, :id, :author, :recipient, :message + json.extract! pm, :id, :author_id, :recipient_id, :message json.url pm_url(pm, format: :json) end diff --git a/app/views/pms/show.json.jbuilder b/app/views/pms/show.json.jbuilder index 651e78f..94252e9 100644 --- a/app/views/pms/show.json.jbuilder +++ b/app/views/pms/show.json.jbuilder @@ -1 +1 @@ -json.extract! @pm, :id, :author, :recipient, :message, :created_at, :updated_at +json.extract! @pm, :id, :author_id, :recipient_id, :message, :created_at, :updated_at diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index a7ead1b..2d1ad24 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -17,11 +17,11 @@
<%= f.label :pw_hash %>
- <%= f.text_field :pw_hash %> + <%= f.text_area :pw_hash %>
<%= f.label :groups %>
- <%= f.text_field :groups %> + <%= f.number_field :groups %>
<%= f.submit %> -- cgit v1.2.3