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:
parent
f9c5e6d40d
commit
9a34cc0b95
11
app/controllers/quantities_controller.rb
Normal file
11
app/controllers/quantities_controller.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
class QuantitiesController < ApplicationController
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
2
app/helpers/quantities_helper.rb
Normal file
2
app/helpers/quantities_helper.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
module QuantitiesHelper
|
||||||
|
end
|
2
app/models/quantity.rb
Normal file
2
app/models/quantity.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
class Quantity < ActiveRecord::Base
|
||||||
|
end
|
1
app/views/quantities/create.html.erb
Normal file
1
app/views/quantities/create.html.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>QuantitiesController#create</h2>
|
1
app/views/quantities/destroy.html.erb
Normal file
1
app/views/quantities/destroy.html.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>QuantitiesController#destroy</h2>
|
1
app/views/quantities/index.html.erb
Normal file
1
app/views/quantities/index.html.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>QuantitiesController#index</h2>
|
@ -6,6 +6,13 @@ class CreateUnits < ActiveRecord::Migration
|
|||||||
t.string :shortname
|
t.string :shortname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table :quantities do |t|
|
||||||
|
t.references :project
|
||||||
|
t.string :name
|
||||||
|
t.string :description
|
||||||
|
t.integer :domain
|
||||||
|
end
|
||||||
|
|
||||||
reversible do |dir|
|
reversible do |dir|
|
||||||
dir.up do
|
dir.up do
|
||||||
Unit.create project: nil, shortname: "%", name: "percent"
|
Unit.create project: nil, shortname: "%", name: "percent"
|
||||||
|
8
test/functional/quantities_controller_test.rb
Normal file
8
test/functional/quantities_controller_test.rb
Normal 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
|
9
test/unit/quantity_test.rb
Normal file
9
test/unit/quantity_test.rb
Normal 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
|
Reference in New Issue
Block a user