hydra-editor 1.0.0.rc3 → 1.0.0.rc4
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.
- checksums.yaml +4 -4
- data/app/forms/hydra_editor/form.rb +3 -1
- data/app/forms/hydra_editor/form/permissions.rb +23 -0
- data/lib/hydra_editor/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 325cf3e65e906a6ddafb4ff4538036e332e4d239
|
4
|
+
data.tar.gz: 4167516a56b1ef54bc3e41bb2687ab3a1ff04203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85070d77bb43738146b022ac4e76b9a9db480105f70c6b4c482a10b5a00e2ee2f6d0ba1c5f1b87d7a3379977a35f2831cc0ea24e9031525dcdd27df89609a20e
|
7
|
+
data.tar.gz: 8fc4702997e582008a6ae01c6e884ca0b05153be79b6a9d54c96c86e7357ae1dc696c0ada33050246a6b06e68d8867293a523d71878eaf3a1f53cf8a6d3033fa
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module HydraEditor
|
2
2
|
module Form
|
3
|
+
extend ActiveSupport::Autoload
|
4
|
+
autoload :Permissions
|
3
5
|
extend ActiveSupport::Concern
|
6
|
+
|
4
7
|
include Hydra::Presenter
|
5
8
|
included do
|
6
9
|
class_attribute :required_fields
|
@@ -50,7 +53,6 @@ module HydraEditor
|
|
50
53
|
permitted << term
|
51
54
|
end
|
52
55
|
end
|
53
|
-
permitted << { permissions_attributes: [:type, :name, :access] }
|
54
56
|
permitted
|
55
57
|
end
|
56
58
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module HydraEditor
|
2
|
+
module Form
|
3
|
+
module Permissions
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
module ClassMethods
|
7
|
+
|
8
|
+
def build_permitted_params
|
9
|
+
permitted = super
|
10
|
+
permitted << { permissions_attributes: [:type, :name, :access, :id, :_destroy] }
|
11
|
+
permitted
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# This is required so that fields_for will draw a nested form.
|
16
|
+
# See ActionView::Helpers#nested_attributes_association?
|
17
|
+
# https://github.com/rails/rails/blob/a04c0619617118433db6e01b67d5d082eaaa0189/actionview/lib/action_view/helpers/form_helper.rb#L1890
|
18
|
+
def permissions_attributes= attributes
|
19
|
+
model.permissions_attributes= attributes
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/hydra_editor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-01-
|
12
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- app/controllers/concerns/records_controller_behavior.rb
|
199
199
|
- app/controllers/records_controller.rb
|
200
200
|
- app/forms/hydra_editor/form.rb
|
201
|
+
- app/forms/hydra_editor/form/permissions.rb
|
201
202
|
- app/helpers/concerns/records_helper_behavior.rb
|
202
203
|
- app/helpers/records_helper.rb
|
203
204
|
- app/inputs/multi_value_input.rb
|