foreman_users 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  module ForemanUsers
2
2
  class Group < ActiveRecord::Base
3
- attr_accessible :name, :ensure, :gid, :groupable_type, :groupable_id, :user_id
3
+ attr_accessible :groupname, :ensure, :gid, :groupable_type, :groupable_id, :user_id
4
4
  belongs_to :user, class_name: "ForemanUsers::User"
5
5
  end
6
6
  end
@@ -1,7 +1,7 @@
1
1
  module ForemanUsers
2
2
  class User < ActiveRecord::Base
3
3
  require "fileutils"
4
- attr_accessible :title, :body, :name, :ensure , :gid, :groups, :home , :password, :password_max_age, :password_min_age, :shell, :uid, :groups_attributes
4
+ attr_accessible :title, :body, :username, :ensure , :gid, :groups, :home , :password, :password_max_age, :password_min_age, :shell, :uid, :groups_attributes
5
5
 
6
6
 
7
7
  has_many :groups, :class_name => 'ForemanTasks::Group', :foreign_key => :user_id
@@ -6,7 +6,7 @@
6
6
  <div class="row">
7
7
  <div class="form-group col-md-6">
8
8
  <label>name</label>
9
- <%= f.text_field :name, :size => "col-md-6", placeholder: "填写用户名", class: "form-control" %>
9
+ <%= f.text_field :username, :size => "col-md-6", placeholder: "填写用户名", class: "form-control" %>
10
10
  </div>
11
11
  <div class="form-group col-md-6">
12
12
  <label for="user_ensure">ensure</label> <br />
@@ -69,7 +69,7 @@
69
69
 
70
70
  <div class="row">
71
71
  <div class=" form-group col-md-4">
72
- <%= groups_form.text_field :name, :size => "col-md-4", placeholder: "填写shell,例如: /bin/bash" , class: "form-control"%>
72
+ <%= groups_form.text_field :groupname, :size => "col-md-4", placeholder: "填写shell,例如: /bin/bash" , class: "form-control"%>
73
73
  </div>
74
74
  <div class=" form-group col-md-4">
75
75
  <%= groups_form.text_field :ensure, :size => "col-md-4", placeholder: "填写shell,例如: /bin/bash" , class: "form-control"%>
@@ -19,7 +19,7 @@
19
19
  <tbody>
20
20
  <% users.each do |user| %>
21
21
  <tr>
22
- <td class=''><%= user.name %></td>
22
+ <td class=''><%= user.username %></td>
23
23
  <td class="hidden-xs"><%= user.ensure %></td>
24
24
  <td class="hidden-xs"><%= user.gid %></td>
25
25
  <td class="hidden-tablet hidden-xs"><%= user.groups %></td>
@@ -2,7 +2,7 @@
2
2
  <%= f.fields_for :group do |f| %>
3
3
  <div class="row">
4
4
  <div class="col-md-4 column form-group">
5
- <%= text_f f, :name, :help_inline => _("填写用户名") %>
5
+ <%= text_f f, :groupname, :help_inline => _("填写用户名") %>
6
6
  </div>
7
7
  <div class="col-md-4 column form-group">
8
8
  <%= text_f f, :name, :help_inline => _("填写用户名") %>
@@ -19,7 +19,7 @@
19
19
  <td><strong>groups</strong></td>
20
20
  </tr>
21
21
  <tr>
22
- <td><%= @user.name %></td>
22
+ <td><%= @user.username %></td>
23
23
  <td><%= @user.ensure %></td>
24
24
  <td><%= @user.gid %></td>
25
25
  <td><%= @user.groups %></td>
@@ -65,7 +65,7 @@
65
65
  <tbody>
66
66
  <% @user.groups.each do |group|%>
67
67
  <tr class="success">
68
- <td><%= group.name %></td>
68
+ <td><%= group.groupname %></td>
69
69
  <td><%= group.ensure %></td>
70
70
  <td><%= group.gid %></td>
71
71
  </tr>
@@ -1,17 +1,19 @@
1
1
  class CreateForemanUsersUsers < ActiveRecord::Migration
2
2
  def change
3
+ drop_table :foreman_users_users if table_exists? :foreman_users_users
4
+
3
5
  create_table :foreman_users_users do |t|
4
- t.string :name #名称
5
- t.string :ensure #下拉菜单
6
- t.string :gid #输入框
7
- t.string :groups #多选
8
- t.string :home #输入
6
+ t.string :username
7
+ t.string :ensure
8
+ t.string :gid
9
+ t.string :groups
10
+ t.string :home
9
11
  t.string :password
10
12
  t.string :password_max_age
11
13
  t.string :password_min_age
12
14
  t.string :shell
13
15
  t.string :uid
14
16
  t.timestamps
15
- end
17
+ end unless table_exists? :foreman_users_users
16
18
  end
17
19
  end
@@ -1,13 +1,14 @@
1
1
  class CreateForemanUsersGroups < ActiveRecord::Migration
2
2
  def change
3
+ drop_table :foreman_users_groups if table_exists? :foreman_users_groups
3
4
  create_table :foreman_users_groups do |t|
4
- t.string :name
5
+ t.string :groupname
5
6
  t.string :ensure
6
7
  t.string :gid
7
8
  t.string :groupable_type
8
9
  t.integer :groupable_id
9
10
  t.integer :user_id
10
11
  t.timestamps
11
- end
12
+ end unless table_exists? :foreman_users_groups
12
13
  end
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanUsers
2
- VERSION = '0.0.16'
2
+ VERSION = '0.0.17'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_users
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: