summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-02-20 17:13:51 -0500
committerDavisLWebb <davislwebb@ymail.com>2014-02-20 17:13:51 -0500
commitcd1fabe40ca4d290df33a2590f3a1f2072103972 (patch)
tree98afd236e1d14e892602304e739fc65d450a43fd /app
parentc14d0327a631a4321464c7c1e250d75458e13f49 (diff)
fix datatype names in generate.sh
Diffstat (limited to 'app')
-rw-r--r--app/controllers/alerts_controller.rb2
-rw-r--r--app/controllers/matches_controller.rb2
-rw-r--r--app/controllers/pms_controller.rb2
-rw-r--r--app/models/alert.rb1
-rw-r--r--app/models/match.rb1
-rw-r--r--app/models/pm.rb2
-rw-r--r--app/models/team_match_pair.rb2
-rw-r--r--app/models/user_team_pair.rb2
-rw-r--r--app/views/alerts/_form.html.erb4
-rw-r--r--app/views/alerts/index.json.jbuilder2
-rw-r--r--app/views/alerts/show.json.jbuilder2
-rw-r--r--app/views/matches/_form.html.erb4
-rw-r--r--app/views/matches/index.json.jbuilder2
-rw-r--r--app/views/matches/show.json.jbuilder2
-rw-r--r--app/views/pms/_form.html.erb8
-rw-r--r--app/views/pms/index.json.jbuilder2
-rw-r--r--app/views/pms/show.json.jbuilder2
-rw-r--r--app/views/users/_form.html.erb4
18 files changed, 27 insertions, 19 deletions
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 %>
<div class="field">
- <%= f.label :author %><br>
- <%= f.text_field :author %>
+ <%= f.label :author_id %><br>
+ <%= f.text_field :author_id %>
</div>
<div class="field">
<%= f.label :message %><br>
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 %>
<div class="field">
- <%= f.label :tournament %><br>
- <%= f.text_field :tournament %>
+ <%= f.label :tournament_id %><br>
+ <%= f.text_field :tournament_id %>
</div>
<div class="actions">
<%= 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 %>
<div class="field">
- <%= f.label :author %><br>
- <%= f.text_field :author %>
+ <%= f.label :author_id %><br>
+ <%= f.text_field :author_id %>
</div>
<div class="field">
- <%= f.label :recipient %><br>
- <%= f.text_field :recipient %>
+ <%= f.label :recipient_id %><br>
+ <%= f.text_field :recipient_id %>
</div>
<div class="field">
<%= f.label :message %><br>
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 @@
</div>
<div class="field">
<%= f.label :pw_hash %><br>
- <%= f.text_field :pw_hash %>
+ <%= f.text_area :pw_hash %>
</div>
<div class="field">
<%= f.label :groups %><br>
- <%= f.text_field :groups %>
+ <%= f.number_field :groups %>
</div>
<div class="actions">
<%= f.submit %>