1
0

Added Quantities model and controller

commands:
rails generate redmine_plugin_model body_tracking quantity
rails generate redmine_plugin_controller body_tracking quantities index
create destroy
This commit is contained in:
cryptogopher 2019-08-23 00:01:10 +02:00
parent f9c5e6d40d
commit 9a34cc0b95
9 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,11 @@
class QuantitiesController < ApplicationController
def index
end
def create
end
def destroy
end
end

View File

@ -0,0 +1,2 @@
module QuantitiesHelper
end

2
app/models/quantity.rb Normal file
View File

@ -0,0 +1,2 @@
class Quantity < ActiveRecord::Base
end

View File

@ -0,0 +1 @@
<h2>QuantitiesController#create</h2>

View File

@ -0,0 +1 @@
<h2>QuantitiesController#destroy</h2>

View File

@ -0,0 +1 @@
<h2>QuantitiesController#index</h2>

View File

@ -6,6 +6,13 @@ class CreateUnits < ActiveRecord::Migration
t.string :shortname
end
create_table :quantities do |t|
t.references :project
t.string :name
t.string :description
t.integer :domain
end
reversible do |dir|
dir.up do
Unit.create project: nil, shortname: "%", name: "percent"

View File

@ -0,0 +1,8 @@
require File.expand_path('../../test_helper', __FILE__)
class QuantitiesControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end

View File

@ -0,0 +1,9 @@
require File.expand_path('../../test_helper', __FILE__)
class QuantityTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end