Task me upstream sync
This commit is contained in:
@@ -5,4 +5,6 @@ class TaskRequest < ApplicationRecord
|
|||||||
enum status: [:pending, :completed, :cancelled]
|
enum status: [:pending, :completed, :cancelled]
|
||||||
|
|
||||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||||
|
|
||||||
|
validates :time_allowed, numericality: { only_integer: true, greater_than_or_equal_to: 2 }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<%= errors_summary_for task_request %>
|
<%= errors_summary_for task_request %>
|
||||||
|
|
||||||
<%= bootstrap_form_with model: model, url: [@project, @task_request, show_chat: true], local: true do |form| %>
|
<%= bootstrap_form_with model: model, url: [@project, @task_request, show_chat: true], local: true do |form| %>
|
||||||
<div class="alert alert-notice text-center pl-0 text-md-left mt-4">
|
<div class="alert alert-info text-center text-md-left">
|
||||||
<%= fa_icon "info-circle" %>
|
<%= fa_icon "info-circle" %>
|
||||||
<strong><%= t '.info_message' %></strong>
|
<strong><%= t '.info_message' %></strong>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
<%= javascript_include_tag "https://js.hs-scripts.com/7344617.js", defer: "defer", async: true, id: "hs-script-loader" %>
|
<%= javascript_include_tag "https://js.hs-scripts.com/7344617.js", defer: "defer", async: true, id: "hs-script-loader" %>
|
||||||
<%= javascript_tag nonce: true do %>
|
<%= javascript_tag nonce: true do %>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
window.HubSpotConversations.widget.open();
|
window.hsConversationsOnReady = [
|
||||||
|
function() {
|
||||||
|
window.HubSpotConversations.widget.open();
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ FactoryBot.define do
|
|||||||
association :project
|
association :project
|
||||||
user_email 'test@email.com'
|
user_email 'test@email.com'
|
||||||
deadline { 10.days.from_now }
|
deadline { 10.days.from_now }
|
||||||
time_allowed "10 days"
|
time_allowed 5
|
||||||
description "Task request"
|
description "Task request"
|
||||||
additional_notes "Additional notes"
|
additional_notes "Additional notes"
|
||||||
status 0
|
status 0
|
||||||
|
|||||||
@@ -13,4 +13,8 @@ RSpec.describe TaskRequest, type: :model do
|
|||||||
subject { described_class }
|
subject { described_class }
|
||||||
it { is_expected.to respond_to(:order_by_recent) }
|
it { is_expected.to respond_to(:order_by_recent) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#validations" do
|
||||||
|
it { should validate_numericality_of(:time_allowed).only_integer.is_greater_than_or_equal_to(2) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user