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
 
117
 
118
     # Never trust parameters from the scary internet, only allow the white list through.
118
     # Never trust parameters from the scary internet, only allow the white list through.
119
     def activity_params
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
     end
121
     end
122
 end
122
 end

+ 2 - 2
app/models/activity.rb

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

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

13
 
13
 
14
   <div class="actions">
14
   <div class="actions">
15
     <div class="form-group">
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
     </div>
18
     </div>
19
     <div class="form-group">
19
     <div class="form-group">
20
       <div class="row">
20
       <div class="row">

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

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

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

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