foreman_datacenter 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bfcfe691d56b5274d821b993d211882e4204c03
4
- data.tar.gz: 441cbf172257fca2c0570fa6c611f84d48dcf5fe
3
+ metadata.gz: f8352bba82a4ef07e0958ff9c75630adae67c8ee
4
+ data.tar.gz: 142eae2fa82b5b0cac2229c5a315ce38815d8c98
5
5
  SHA512:
6
- metadata.gz: 232ebc810f7c3dda06f939eea57f8b6989ccdf4b53437eb7c175491451a6539511bfb9614a9010b8f9d0e1ce44b87d63c93180f0ebc61d842bdf77d917430b09
7
- data.tar.gz: 37ffaa904453442a790f5cf17d9ee6d112eab189c292c4f228719d818f27f573c6fe0489a0a7d3bc87c107a720bbababf5c3d4921b9c6dc65c6c0cccbc8517fb
6
+ metadata.gz: 6619472342de107a5ca385befff75e630b9bca73781debc4b72ed47617c83c912202e9c7a9b459127fe29ac5c11927dacf655c054f795f45b45a58317790e91d
7
+ data.tar.gz: 5999ec8f590a3b7a16f88a98fcf05e59f644c457282494ed97d4a41c1fed24df1c163f6206e9834f7a6d28ba7c0a110dc240e3f233e26f1bf824783c053613a1
@@ -0,0 +1,18 @@
1
+ module ForemanDatacenter
2
+ class CommentsController < ApplicationController
3
+ def new
4
+ end
5
+
6
+ def edit
7
+ end
8
+
9
+ def create
10
+ end
11
+
12
+ def update
13
+ end
14
+
15
+ def destroy
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module ForemanDatacenter
2
+ class Comment < ActiveRecord::Base
3
+ belongs_to :commentable, polymorphic: true
4
+ end
5
+ end
@@ -28,6 +28,9 @@ module ForemanDatacenter
28
28
  has_one :management_device, :class_name => 'ForemanDatacenter::ManagementDevice'
29
29
  has_one :site, :through => :rack
30
30
 
31
+ has_many :comments, :class_name => 'ForemanDatacenter::Comment',
32
+ dependent: :destroy
33
+
31
34
  enum face: [:front, :rear]
32
35
  enum side: [:left, :right, :full]
33
36
  enum status: [:active, :offline]
@@ -0,0 +1,2 @@
1
+ <h1>Comments#create</h1>
2
+ <p>Find me in app/views/comments/create.html.erb</p>
@@ -0,0 +1,3 @@
1
+ <h1>Comments#edit</h1>
2
+ <p>Find me in app/views/comments/edit.html.erb</p>
3
+
@@ -0,0 +1,2 @@
1
+ <h1>Comments#new</h1>
2
+ <p>Find me in app/views/comments/new.html.erb</p>
data/config/routes.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  Foreman::Application.routes.draw do
2
+
2
3
  # TODO: find a better way to do this
3
4
  get 'datacenter/import_to_device', to: 'hosts#import_to_device',
4
5
  as: 'import_to_device'
@@ -81,6 +82,8 @@ Foreman::Application.routes.draw do
81
82
  resources :device_modules, except: [:show, :index], shallow: true
82
83
  resources :management_devices, only: [:new, :create, :edit, :update, :destroy],
83
84
  shallow: true
85
+
86
+ resources :comments, except: [:show, :index]
84
87
  end
85
88
  resources :device_interface_connections, only: [:index], path: 'connections' do
86
89
  get :interfaces, on: :collection
@@ -0,0 +1,11 @@
1
+ class CreateComments < ActiveRecord::Migration
2
+ def change
3
+ create_table :comments do |t|
4
+ t.text :content
5
+ t.belongs_to :commentable, polymorphic: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ add_index :comments, [:commentable_id, :commentable_type]
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanDatacenter
2
- VERSION = '0.1.17'.freeze
2
+ VERSION = '0.1.18'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_datacenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Ivanov
@@ -113,6 +113,7 @@ files:
113
113
  - app/assets/javascripts/foreman_datacenter/shared.js
114
114
  - app/assets/stylesheets/foreman_datacenter/device_interface_connections.css
115
115
  - app/controllers/concerns/foreman_datacenter/hosts_controller_extensions.rb
116
+ - app/controllers/foreman_datacenter/comments_controller.rb
116
117
  - app/controllers/foreman_datacenter/console_port_templates_controller.rb
117
118
  - app/controllers/foreman_datacenter/console_ports_controller.rb
118
119
  - app/controllers/foreman_datacenter/console_server_port_templates_controller.rb
@@ -151,6 +152,7 @@ files:
151
152
  - app/helpers/foreman_datacenter/racks_helper.rb
152
153
  - app/helpers/foreman_datacenter/shared_helper.rb
153
154
  - app/models/concerns/foreman_datacenter/host_extensions.rb
155
+ - app/models/foreman_datacenter/comment.rb
154
156
  - app/models/foreman_datacenter/console_port.rb
155
157
  - app/models/foreman_datacenter/console_port_template.rb
156
158
  - app/models/foreman_datacenter/console_server_port.rb
@@ -174,6 +176,9 @@ files:
174
176
  - app/models/foreman_datacenter/rack.rb
175
177
  - app/models/foreman_datacenter/rack_group.rb
176
178
  - app/models/foreman_datacenter/site.rb
179
+ - app/views/foreman_datacenter/comments/create.html.erb
180
+ - app/views/foreman_datacenter/comments/edit.html.erb
181
+ - app/views/foreman_datacenter/comments/new.html.erb
177
182
  - app/views/foreman_datacenter/console_port_templates/_form.html.erb
178
183
  - app/views/foreman_datacenter/console_port_templates/new.html.erb
179
184
  - app/views/foreman_datacenter/console_ports/_for_device.html.erb
@@ -317,6 +322,7 @@ files:
317
322
  - db/migrate/20160920221011_remove_index_from_devices.rb
318
323
  - db/migrate/20170824122025_add_side_to_device.rb
319
324
  - db/migrate/20170918202630_add_racksize_to_device.rb
325
+ - db/migrate/20170922110137_create_comments.rb
320
326
  - lib/foreman_datacenter.rb
321
327
  - lib/foreman_datacenter/engine.rb
322
328
  - lib/foreman_datacenter/version.rb