Browse Source

:s/public_name/name/g

Maarten van den Berg 7 years ago
parent
commit
5954fc0d65

+ 1 - 1
app/controllers/activities_controller.rb

@@ -117,6 +117,6 @@ class ActivitiesController < ApplicationController
117 117
 
118 118
     # Never trust parameters from the scary internet, only allow the white list through.
119 119
     def activity_params
120
-      params.require(:activity).permit(:public_name, :description, :location, :start, :end, :deadline)
120
+      params.require(:activity).permit(:name, :description, :location, :start, :end, :deadline)
121 121
     end
122 122
 end

+ 2 - 2
app/models/activity.rb

@@ -1,7 +1,7 @@
1 1
 # An Activity represents a single continuous event that the members of a group may attend.
2 2
 # An Activity belongs to a group, and has many participants.
3 3
 class Activity < ApplicationRecord
4
-  # @!attribute public_name
4
+  # @!attribute name
5 5
   #   @return [String]
6 6
   #     a short name for the activity.
7 7
   #
@@ -35,7 +35,7 @@ class Activity < ApplicationRecord
35 35
     dependent: :destroy
36 36
   has_many :people, through: :participants
37 37
 
38
-  validates :public_name, presence: true
38
+  validates :name, presence: true
39 39
   validates :start, presence: true
40 40
   validate  :deadline_before_start, unless: "self.deadline.blank?"
41 41
   validate  :end_after_start,       unless: "self.end.blank?"

+ 2 - 2
app/views/activities/_form.html.erb

@@ -13,8 +13,8 @@
13 13
 
14 14
   <div class="actions">
15 15
     <div class="form-group">
16
-      <%= f.label :public_name %>
17
-      <%= f.text_field :public_name, class: 'form-control' %>
16
+      <%= f.label :name %>
17
+      <%= f.text_field :name, class: 'form-control' %>
18 18
     </div>
19 19
     <div class="form-group">
20 20
       <div class="row">

+ 1 - 1
app/views/activities/show.html.haml

@@ -2,7 +2,7 @@
2 2
   .col-md-9
3 3
     .panel.panel-default
4 4
       .panel-heading
5
-        = @activity.public_name
5
+        = @activity.name
6 6
         - if @activity.may_change?(current_person)
7 7
           = link_to edit_group_activity_path(@group, @activity), class: 'pull-right' do
8 8
             %i.fa.fa-pencil

+ 3 - 3
app/views/groups/show.html.haml

@@ -43,7 +43,7 @@
43 43
               %tr
44 44
                 %td
45 45
                   = link_to group_activity_path(@group, a) do
46
-                    = a.public_name
46
+                    = a.name
47 47
                     = render partial: "activities/state_counts", locals: {counts: a.state_counts}
48 48
                 %td
49 49
                   = distance_of_time_in_words_to_now(a.start)
@@ -63,7 +63,7 @@
63 63
                 %tr{class: p.row_class, data: {activity_id: a.id, person_id: current_person.id}}
64 64
                   %td
65 65
                     = link_to group_activity_path(a.group, a) do
66
-                      = a.public_name
66
+                      = a.name
67 67
                   %td
68 68
                     = render partial: "activities/presence_buttons", locals: {activity: a, person: current_person, state: p.attending}
69 69
                   %td
@@ -72,6 +72,6 @@
72 72
                 %tr
73 73
                   %td
74 74
                     = link_to group_activity_path(a.group, a) do
75
-                      = a.public_name
75
+                      = a.name
76 76
                   %td
77 77
                   %td