arpa 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +42 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +138 -0
  8. data/Rakefile +2 -0
  9. data/arpa.gemspec +33 -0
  10. data/lib/arpa.rb +91 -0
  11. data/lib/arpa/additions/resource.rb +29 -0
  12. data/lib/arpa/assets/stylesheets/ar_accordion.scss +80 -0
  13. data/lib/arpa/controllers/profiles_controller.rb +106 -0
  14. data/lib/arpa/controllers/resources_controller.rb +47 -0
  15. data/lib/arpa/controllers/roles_controller.rb +106 -0
  16. data/lib/arpa/data_mappers/action_mapper.rb +13 -0
  17. data/lib/arpa/data_mappers/base.rb +117 -0
  18. data/lib/arpa/data_mappers/profile_mapper.rb +14 -0
  19. data/lib/arpa/data_mappers/resource_mapper.rb +11 -0
  20. data/lib/arpa/data_mappers/role_mapper.rb +14 -0
  21. data/lib/arpa/entities/action.rb +24 -0
  22. data/lib/arpa/entities/permissions.rb +35 -0
  23. data/lib/arpa/entities/profile.rb +22 -0
  24. data/lib/arpa/entities/resource.rb +58 -0
  25. data/lib/arpa/entities/role.rb +28 -0
  26. data/lib/arpa/exceptions/record_invalid.rb +13 -0
  27. data/lib/arpa/repositories/actions/creator.rb +18 -0
  28. data/lib/arpa/repositories/actions/finder.rb +23 -0
  29. data/lib/arpa/repositories/actions/remover.rb +22 -0
  30. data/lib/arpa/repositories/actions/repository_action.rb +15 -0
  31. data/lib/arpa/repositories/base.rb +15 -0
  32. data/lib/arpa/repositories/profiles/creator.rb +18 -0
  33. data/lib/arpa/repositories/profiles/finder.rb +29 -0
  34. data/lib/arpa/repositories/profiles/remover.rb +29 -0
  35. data/lib/arpa/repositories/profiles/repository_profile.rb +12 -0
  36. data/lib/arpa/repositories/profiles/updater.rb +23 -0
  37. data/lib/arpa/repositories/registrator.rb +44 -0
  38. data/lib/arpa/repositories/resources/creator.rb +18 -0
  39. data/lib/arpa/repositories/resources/finder.rb +45 -0
  40. data/lib/arpa/repositories/resources/remover.rb +22 -0
  41. data/lib/arpa/repositories/resources/repository_resource.rb +12 -0
  42. data/lib/arpa/repositories/roles/creator.rb +18 -0
  43. data/lib/arpa/repositories/roles/finder.rb +29 -0
  44. data/lib/arpa/repositories/roles/remover.rb +29 -0
  45. data/lib/arpa/repositories/roles/repository_role.rb +13 -0
  46. data/lib/arpa/repositories/roles/updater.rb +23 -0
  47. data/lib/arpa/services/actions/create/action_creator.rb +50 -0
  48. data/lib/arpa/services/actions/remove/action_remover.rb +24 -0
  49. data/lib/arpa/services/base.rb +41 -0
  50. data/lib/arpa/services/profiles/create/profile_creator.rb +32 -0
  51. data/lib/arpa/services/profiles/profile_manager_creator.rb +22 -0
  52. data/lib/arpa/services/profiles/profile_manager_remover.rb +24 -0
  53. data/lib/arpa/services/profiles/profile_manager_updater.rb +22 -0
  54. data/lib/arpa/services/profiles/remove/profile_remover.rb +25 -0
  55. data/lib/arpa/services/profiles/update/profile_updater.rb +32 -0
  56. data/lib/arpa/services/resources/create/resource_creator.rb +42 -0
  57. data/lib/arpa/services/resources/remove/resource_remover.rb +31 -0
  58. data/lib/arpa/services/resources/resource_manager_creator.rb +50 -0
  59. data/lib/arpa/services/roles/create/role_creator.rb +33 -0
  60. data/lib/arpa/services/roles/remove/role_remover.rb +25 -0
  61. data/lib/arpa/services/roles/role_manager_creator.rb +23 -0
  62. data/lib/arpa/services/roles/role_manager_remover.rb +23 -0
  63. data/lib/arpa/services/roles/role_manager_updater.rb +22 -0
  64. data/lib/arpa/services/roles/update/role_updater.rb +32 -0
  65. data/lib/arpa/services/verifier.rb +24 -0
  66. data/lib/arpa/validators/action_validator.rb +17 -0
  67. data/lib/arpa/validators/profile_validator.rb +19 -0
  68. data/lib/arpa/validators/resource_validator.rb +17 -0
  69. data/lib/arpa/validators/role_validator.rb +20 -0
  70. data/lib/arpa/version.rb +3 -0
  71. data/lib/arpa/views/profiles/_form.html.erb +41 -0
  72. data/lib/arpa/views/profiles/edit.html.erb +6 -0
  73. data/lib/arpa/views/profiles/index.html.erb +29 -0
  74. data/lib/arpa/views/profiles/new.html.erb +5 -0
  75. data/lib/arpa/views/profiles/show.html.erb +37 -0
  76. data/lib/arpa/views/resources/index.html.erb +27 -0
  77. data/lib/arpa/views/resources/show.html.erb +33 -0
  78. data/lib/arpa/views/roles/_form.html.erb +55 -0
  79. data/lib/arpa/views/roles/edit.html.erb +6 -0
  80. data/lib/arpa/views/roles/index.html.erb +29 -0
  81. data/lib/arpa/views/roles/new.html.erb +5 -0
  82. data/lib/arpa/views/roles/show.html.erb +37 -0
  83. data/lib/config/locales/arpa.en.yml +38 -0
  84. data/lib/generators/ar/install_generator.rb +74 -0
  85. data/lib/generators/ar/templates/migration.rb +48 -0
  86. data/spec/factories/repository_actions.rb +19 -0
  87. data/spec/factories/repository_profiles.rb +11 -0
  88. data/spec/factories/repository_resources.rb +15 -0
  89. data/spec/factories/repository_roles.rb +11 -0
  90. data/spec/lib/ar/additions/resource_spec.rb +34 -0
  91. data/spec/lib/ar/data_mappers/action_mapper_spec.rb +46 -0
  92. data/spec/lib/ar/data_mappers/base_spec.rb +47 -0
  93. data/spec/lib/ar/data_mappers/profile_mapper_spec.rb +43 -0
  94. data/spec/lib/ar/data_mappers/resource_mapper_spec.rb +38 -0
  95. data/spec/lib/ar/data_mappers/role_mapper_spec.rb +47 -0
  96. data/spec/lib/ar/entities/action_spec.rb +19 -0
  97. data/spec/lib/ar/entities/permissions_spec.rb +61 -0
  98. data/spec/lib/ar/entities/resource_spec.rb +35 -0
  99. data/spec/lib/ar/repositories/actions/finder_spec.rb +40 -0
  100. data/spec/lib/ar/repositories/base_spec.rb +37 -0
  101. data/spec/lib/ar/repositories/profiles/finder_spec.rb +43 -0
  102. data/spec/lib/ar/repositories/profiles/remover_spec.rb +31 -0
  103. data/spec/lib/ar/repositories/resources/finder_spec.rb +92 -0
  104. data/spec/lib/ar/repositories/resources/remover_spec.rb +38 -0
  105. data/spec/lib/ar/repositories/roles/finder_spec.rb +43 -0
  106. data/spec/lib/ar/repositories/roles/remover_spec.rb +31 -0
  107. data/spec/lib/ar/requests/profiles/create_request_spec.rb +51 -0
  108. data/spec/lib/ar/requests/profiles/remove_request_spec.rb +36 -0
  109. data/spec/lib/ar/requests/resources/create_request_spec.rb +107 -0
  110. data/spec/lib/ar/requests/roles/create_request_spec.rb +40 -0
  111. data/spec/lib/ar/requests/roles/remove_request_spec.rb +23 -0
  112. data/spec/lib/ar/requests/roles/update_request_spec.rb +50 -0
  113. data/spec/lib/ar/services/actions/create/action_creator_spec.rb +88 -0
  114. data/spec/lib/ar/services/actions/remove/action_remover_spec.rb +36 -0
  115. data/spec/lib/ar/services/base_spec.rb +94 -0
  116. data/spec/lib/ar/services/profiles/create/profile_creator_spec.rb +68 -0
  117. data/spec/lib/ar/services/profiles/profile_manager_creator_spec.rb +31 -0
  118. data/spec/lib/ar/services/profiles/profile_manager_remover_spec.rb +44 -0
  119. data/spec/lib/ar/services/profiles/profile_manager_updater_spec.rb +31 -0
  120. data/spec/lib/ar/services/profiles/remove/profile_remover_spec.rb +45 -0
  121. data/spec/lib/ar/services/profiles/update/profile_updater_spec.rb +68 -0
  122. data/spec/lib/ar/services/resources/create/resource_creator_spec.rb +87 -0
  123. data/spec/lib/ar/services/resources/remove/resource_remover_spec.rb +50 -0
  124. data/spec/lib/ar/services/resources/resource_manager_creator_spec.rb +71 -0
  125. data/spec/lib/ar/services/roles/create/role_creator_spec.rb +68 -0
  126. data/spec/lib/ar/services/roles/remove/role_remover_spec.rb +50 -0
  127. data/spec/lib/ar/services/roles/role_manager_creator_spec.rb +31 -0
  128. data/spec/lib/ar/services/roles/role_manager_remover_spec.rb +32 -0
  129. data/spec/lib/ar/services/roles/role_manager_updater_spec.rb +31 -0
  130. data/spec/lib/ar/services/roles/update/role_updater_spec.rb +68 -0
  131. data/spec/lib/ar/services/verifier_spec.rb +44 -0
  132. data/spec/lib/ar/validators/action_validator_spec.rb +15 -0
  133. data/spec/lib/ar/validators/profile_validator_spec.rb +16 -0
  134. data/spec/lib/ar/validators/resource_validator_spec.rb +15 -0
  135. data/spec/lib/ar/validators/role_validator_spec.rb +16 -0
  136. data/spec/spec_helper.rb +33 -0
  137. data/spec/support/repositories/test_repository.rb +2 -0
  138. data/spec/support/schema.rb +58 -0
  139. metadata +380 -0
@@ -0,0 +1,6 @@
1
+ <h1>Editing Profile</h1>
2
+
3
+ <%= render 'form', action: 'update', method: :patch %>
4
+
5
+ <%= link_to 'Show', profile_path(@profile.id) %> |
6
+ <%= link_to 'Back', profiles_path %>
@@ -0,0 +1,29 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Profiles</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th>Description</th>
10
+ <th colspan="3"></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @profiles.each do |profile| %>
16
+ <tr>
17
+ <td><%= profile.name %></td>
18
+ <td><%= profile.description %></td>
19
+ <td><%= link_to 'Show', profile_path(profile.id) %></td>
20
+ <td><%= link_to 'Edit', edit_profile_path(profile.id) %></td>
21
+ <td><%= link_to 'Destroy', profile_path(profile.id), method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
26
+
27
+ <br>
28
+
29
+ <%= link_to 'New Profile', new_profile_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Profile</h1>
2
+
3
+ <%= render 'form', action: 'create', method: :post %>
4
+
5
+ <%= link_to 'Back', profiles_path %>
@@ -0,0 +1,37 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @profile.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Description:</strong>
10
+ <%= @profile.description %>
11
+ </p>
12
+
13
+ <table>
14
+ <div class="table-header">
15
+ <div class="text-sm">
16
+ <strong>List of Roles</strong>
17
+ </div>
18
+ </div>
19
+
20
+ <thead>
21
+ <tr>
22
+ <th>Name</th>
23
+ <th>Description</th>
24
+ </tr>
25
+ </thead>
26
+
27
+ <tbody>
28
+ <% @profile.roles.each do |role| %>
29
+ <tr>
30
+ <td><%= role.name %></td>
31
+ <td><%= role.description %></td>
32
+ </tr>
33
+ <% end %>
34
+ </tbody>
35
+ </table>
36
+
37
+ <%= link_to 'Back', profiles_path %>
@@ -0,0 +1,27 @@
1
+ <p id="notice"><%= notice %></p>
2
+ <p id="alert"><%= alert %></p>
3
+
4
+
5
+ <h1>Listing Resources</h1>
6
+
7
+ <table>
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th colspan="3"></th>
12
+ </tr>
13
+ </thead>
14
+
15
+ <tbody>
16
+ <% @resources.each do |resource| %>
17
+ <tr>
18
+ <td><%= resource.name %></td>
19
+ <td><%= link_to 'Show', resource_path(resource.id) %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+
25
+ <br>
26
+
27
+ <%= link_to 'Generate All Resources', generate_resources_and_actions_resources_path %>
@@ -0,0 +1,33 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @resource.name %>
6
+ </p>
7
+
8
+ <table>
9
+ <div class="table-header">
10
+ <div class="text-sm">
11
+ <strong>List of Actions</strong>
12
+ </div>
13
+ </div>
14
+
15
+ <thead>
16
+ <tr>
17
+ <th>Name</th>
18
+ <th>Description</th>
19
+ </tr>
20
+ </thead>
21
+
22
+ <tbody>
23
+ <% @resource.actions.each do |action| %>
24
+ <tr>
25
+ <td><%= action.name %></td>
26
+ <td><%= action.description %></td>
27
+ </tr>
28
+ <% end %>
29
+ </tbody>
30
+ </table>
31
+
32
+
33
+ <%= link_to 'Back', resources_path %>
@@ -0,0 +1,55 @@
1
+ <%= form_for(:role, url: {action: action}, method: method) do |f| %>
2
+ <% if @error.present? && @error.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@error.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @error.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <%= f.hidden_field :id, value: @role.id %>
15
+
16
+ <div class="field">
17
+ <%= f.label :name %><br>
18
+ <%= f.text_field :name %>
19
+ </div>
20
+
21
+ <div class="field">
22
+ <%= f.label :description %><br>
23
+ <%= f.text_field :description %>
24
+ </div>
25
+
26
+ <div class="ar-accordion">
27
+
28
+ <% @resources.each do |resource| %>
29
+ <div class="ar-accordion-item">
30
+ <input class="ar-accordion-input" id="<%= resource.id %>" type="checkbox">
31
+ <label class="ar-accordion-title" for="<%= resource.id %>">
32
+ <%= resource.name %>
33
+ </label>
34
+
35
+ <div class="ar-accordion-content">
36
+ <% resource.actions.each do |action| %>
37
+ <div>
38
+ <input type="checkbox" name="role[action_ids][]" value="<%= action.id %>" <%= checked="checked" if @role.action_ids.include?(action.id) %> >
39
+ <%= action.name%>
40
+ </div>
41
+
42
+ <% end %>
43
+ </div>
44
+
45
+ </div>
46
+
47
+ <% end %>
48
+
49
+ </div>
50
+
51
+ <div class="actions">
52
+ <%= f.submit %>
53
+ </div>
54
+
55
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Role</h1>
2
+
3
+ <%= render 'form', action: 'update', method: :patch %>
4
+
5
+ <%= link_to 'Show', role_path(@role.id) %> |
6
+ <%= link_to 'Back', roles_path %>
@@ -0,0 +1,29 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Roles</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th>Description</th>
10
+ <th colspan="3"></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @roles.each do |role| %>
16
+ <tr>
17
+ <td><%= role.name %></td>
18
+ <td><%= role.description %></td>
19
+ <td><%= link_to 'Show', role_path(role.id) %></td>
20
+ <td><%= link_to 'Edit', edit_role_path(role.id) %></td>
21
+ <td><%= link_to 'Destroy', role_path(role.id), method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
26
+
27
+ <br>
28
+
29
+ <%= link_to 'New Role', new_role_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Role</h1>
2
+
3
+ <%= render 'form', action: 'create', method: :post %>
4
+
5
+ <%= link_to 'Back', roles_path %>
@@ -0,0 +1,37 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @role.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Description:</strong>
10
+ <%= @role.description %>
11
+ </p>
12
+
13
+ <table>
14
+ <div class="table-header">
15
+ <div class="text-sm">
16
+ <strong>List of Actions</strong>
17
+ </div>
18
+ </div>
19
+
20
+ <thead>
21
+ <tr>
22
+ <th>Name</th>
23
+ <th>Description</th>
24
+ </tr>
25
+ </thead>
26
+
27
+ <tbody>
28
+ <% @role.actions.each do |action| %>
29
+ <tr>
30
+ <td><%= action.name %></td>
31
+ <td><%= action.description %></td>
32
+ </tr>
33
+ <% end %>
34
+ </tbody>
35
+ </table>
36
+
37
+ <%= link_to 'Back', roles_path %>
@@ -0,0 +1,38 @@
1
+ en:
2
+ entities:
3
+ resources:
4
+ users:
5
+ actions:
6
+ description:
7
+ index: 'List of Users'
8
+ show: 'Show of User'
9
+ new: 'Access to registration form of User'
10
+ edit: 'Access to change form of User'
11
+ create: 'Perform action registering of User'
12
+ update: 'Perform action update of User'
13
+ destroy: 'Perform action destroy of User'
14
+
15
+ errors:
16
+ format: ! '%{attribute} %{message}'
17
+ messages:
18
+ many_blank: 'you must select at least one'
19
+
20
+ flash:
21
+ actions:
22
+ generate_resources_and_actions:
23
+ notice: 'Resources have been successfully created'
24
+ alert: 'Resources were not successfully created'
25
+ create_role:
26
+ notice: 'Role was successfully created'
27
+ update_role:
28
+ notice: 'Role was successfully updated'
29
+ remove_role:
30
+ notice: 'Role was successfully removed'
31
+ alert: 'Fail when tried remove a Role'
32
+ create_profile:
33
+ notice: 'Profile was successfully created'
34
+ update_profile:
35
+ notice: 'Profile was successfully updated'
36
+ remove_profile:
37
+ notice: 'Profile was successfully removed'
38
+ alert: 'Fail when tried remove a Profile'
@@ -0,0 +1,74 @@
1
+ module Arpa
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ include Rails::Generators::Migration
5
+
6
+ source_root File.expand_path("..", __FILE__)
7
+
8
+ def self.next_migration_number(dirname)
9
+ return Time.new.utc.strftime("%Y%m%d%H%M%S") if ActiveRecord::Base.timestamped_migrations
10
+ "%.3d" % (current_migration_number(dirname) + 1)
11
+ end
12
+
13
+ def create_migrate_files
14
+ migration_template 'templates/migration.rb', 'db/migrate/create_arpa_tables.rb'
15
+ end
16
+
17
+ def copy_resources_views_files
18
+ copy_file '../../arpa/views/resources/index.html.erb', 'app/views/arpa/resources/index.html.erb'
19
+ copy_file '../../arpa/views/resources/show.html.erb', 'app/views/arpa/resources/show.html.erb'
20
+
21
+ copy_file '../../arpa/views/roles/index.html.erb', 'app/views/arpa/roles/index.html.erb'
22
+ copy_file '../../arpa/views/roles/show.html.erb', 'app/views/arpa/roles/show.html.erb'
23
+ copy_file '../../arpa/views/roles/new.html.erb', 'app/views/arpa/roles/new.html.erb'
24
+ copy_file '../../arpa/views/roles/edit.html.erb', 'app/views/arpa/roles/edit.html.erb'
25
+ copy_file '../../arpa/views/roles/_form.html.erb', 'app/views/arpa/roles/_form.html.erb'
26
+
27
+ copy_file '../../arpa/views/profiles/index.html.erb', 'app/views/arpa/profiles/index.html.erb'
28
+ copy_file '../../arpa/views/profiles/show.html.erb', 'app/views/arpa/profiles/show.html.erb'
29
+ copy_file '../../arpa/views/profiles/new.html.erb', 'app/views/arpa/profiles/new.html.erb'
30
+ copy_file '../../arpa/views/profiles/edit.html.erb', 'app/views/arpa/profiles/edit.html.erb'
31
+ copy_file '../../arpa/views/profiles/_form.html.erb', 'app/views/arpa/profiles/_form.html.erb'
32
+ end
33
+
34
+ def copy_stylesheet_files
35
+ copy_file '../../arpa/assets/stylesheets/arpa_accordion.scss', 'app/assets/stylesheets/arpa/arpa_accordion.scss'
36
+ end
37
+
38
+ def add_controllers
39
+ copy_file '../../arpa/controllers/resources_controller.rb', 'app/controllers/arpa/resources_controller.rb'
40
+ copy_file '../../arpa/controllers/roles_controller.rb', 'app/controllers/arpa/roles_controller.rb'
41
+ copy_file '../../arpa/controllers/profiles_controller.rb', 'app/controllers/arpa/profiles_controller.rb'
42
+ end
43
+
44
+ def add_routes
45
+ route <<-RUBY
46
+ scope module: :arpa do
47
+ resources :resources do
48
+ collection do
49
+ get 'generate_resources_and_actions'
50
+ end
51
+ end
52
+
53
+ resources :roles do
54
+ collection do
55
+ delete ':id', to: 'roles#remove'
56
+ end
57
+ end
58
+
59
+ resources :profiles do
60
+ collection do
61
+ delete ':id', to: 'profiles#remove'
62
+ end
63
+ end
64
+ end
65
+ RUBY
66
+ end
67
+
68
+ def copy_locales
69
+ copy_file '../../config/locales/arpa.en.yml', 'config/locales/arpa.en.yml'
70
+ end
71
+
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,48 @@
1
+ class CreateArTables < ActiveRecord::Migration
2
+ def change
3
+
4
+ create_table :repository_resources, :force => true do |t|
5
+ t.string :name
6
+ t.string :full_name
7
+ t.timestamps null: false
8
+ end
9
+
10
+ create_table :repository_actions, :force => true do |t|
11
+ t.string :name
12
+ t.references :repository_resource, index: true
13
+ t.timestamps null: false
14
+ end
15
+
16
+ add_foreign_key :repository_actions, :repository_resources
17
+
18
+ create_table :repository_roles, :force => true do |t|
19
+ t.string :name
20
+ t.string :description
21
+ t.boolean :removed, default: false
22
+ t.timestamps null: false
23
+ end
24
+
25
+ create_join_table :repository_actions, :repository_roles, :force => true do |t|
26
+ t.index :repository_action_id, name: 'action_role_id'
27
+ t.index :repository_role_id, name: 'role_action_id'
28
+ end
29
+
30
+ create_table :repository_profiles, :force => true do |t|
31
+ t.string :name
32
+ t.string :description
33
+ t.boolean :removed, default: false
34
+ t.timestamps null: false
35
+ end
36
+
37
+ create_join_table :repository_roles, :repository_profiles, :force => true do |t|
38
+ t.index :repository_role_id, name: 'role_profile_id'
39
+ t.index :repository_profile_id, name: 'profile_role_ids'
40
+ end
41
+
42
+ create_join_table :repository_profiles, :users, :force => true do |t|
43
+ t.index :repository_profile_id, name: 'profile_user_id'
44
+ t.index :user_id, name: 'user_profile_id'
45
+ end
46
+
47
+ end
48
+ end