##// END OF EJS Templates
Raises time entries comments limit to 1024 (#19885)....
Jean-Philippe Lang -
r14239:5882629e26ab
parent child
Show More
@@ -0,0 +1,9
1 class ChangeTimeEntriesCommentsLimitTo1024 < ActiveRecord::Migration
2 def self.up
3 change_column :time_entries, :comments, :string, :limit => 1024
4 end
5
6 def self.down
7 change_column :time_entries, :comments, :string, :limit => 255
8 end
9 end
@@ -39,7 +39,7 class TimeEntry < ActiveRecord::Base
39
39
40 validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
40 validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
41 validates_numericality_of :hours, :allow_nil => true, :message => :invalid
41 validates_numericality_of :hours, :allow_nil => true, :message => :invalid
42 validates_length_of :comments, :maximum => 255, :allow_nil => true
42 validates_length_of :comments, :maximum => 1024, :allow_nil => true
43 validates :spent_on, :date => true
43 validates :spent_on, :date => true
44 before_validation :set_project_if_nil
44 before_validation :set_project_if_nil
45 validate :validate_time_entry
45 validate :validate_time_entry
@@ -17,7 +17,7
17 </p>
17 </p>
18 <p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
18 <p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
19 <p><%= f.text_field :hours, :size => 6, :required => true %></p>
19 <p><%= f.text_field :hours, :size => 6, :required => true %></p>
20 <p><%= f.text_field :comments, :size => 100, :maxlength => 255 %></p>
20 <p><%= f.text_field :comments, :size => 100, :maxlength => 1024 %></p>
21 <p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
21 <p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
22 <% @time_entry.custom_field_values.each do |value| %>
22 <% @time_entry.custom_field_values.each do |value| %>
23 <p><%= custom_field_tag_with_label :time_entry, value %></p>
23 <p><%= custom_field_tag_with_label :time_entry, value %></p>
General Comments 0
You need to be logged in to leave comments. Login now