Added Sources model + controller
commands: rails generate redmine_plugin_model body_tracking source project:references name:string description:text rails generate redmine_plugin_controller body_tracking sources index create destroy
This commit is contained in:
parent
2e9d353935
commit
0b549b909a
11
app/controllers/sources_controller.rb
Normal file
11
app/controllers/sources_controller.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
class SourcesController < ApplicationController
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
end
|
||||||
|
end
|
2
app/helpers/sources_helper.rb
Normal file
2
app/helpers/sources_helper.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
module SourcesHelper
|
||||||
|
end
|
2
app/models/source.rb
Normal file
2
app/models/source.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
class Source < ActiveRecord::Base
|
||||||
|
end
|
1
app/views/sources/create.html.erb
Normal file
1
app/views/sources/create.html.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>SourcesController#create</h2>
|
1
app/views/sources/destroy.html.erb
Normal file
1
app/views/sources/destroy.html.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>SourcesController#destroy</h2>
|
1
app/views/sources/index.html.erb
Normal file
1
app/views/sources/index.html.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>SourcesController#index</h2>
|
10
db/migrate/002_create_sources.rb
Normal file
10
db/migrate/002_create_sources.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class CreateSources < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :sources do |t|
|
||||||
|
t.references :project, index: true, foreign_key: true
|
||||||
|
t.string :name
|
||||||
|
t.text :description
|
||||||
|
end
|
||||||
|
add_index :sources, :project_id
|
||||||
|
end
|
||||||
|
end
|
8
test/functional/sources_controller_test.rb
Normal file
8
test/functional/sources_controller_test.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
|
class SourcesControllerTest < ActionController::TestCase
|
||||||
|
# Replace this with your real tests.
|
||||||
|
def test_truth
|
||||||
|
assert true
|
||||||
|
end
|
||||||
|
end
|
9
test/unit/source_test.rb
Normal file
9
test/unit/source_test.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
|
class SourceTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
|
# Replace this with your real tests.
|
||||||
|
def test_truth
|
||||||
|
assert true
|
||||||
|
end
|
||||||
|
end
|
Reference in New Issue
Block a user