hydra-editor 1.0.0.rc4 → 1.0.0

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: 325cf3e65e906a6ddafb4ff4538036e332e4d239
4
- data.tar.gz: 4167516a56b1ef54bc3e41bb2687ab3a1ff04203
3
+ metadata.gz: eac05a72b8cbd9e9c924045e105a868242f4ae99
4
+ data.tar.gz: 50f24d9ce0f26b09ea8bee01b71195d67fd70e02
5
5
  SHA512:
6
- metadata.gz: 85070d77bb43738146b022ac4e76b9a9db480105f70c6b4c482a10b5a00e2ee2f6d0ba1c5f1b87d7a3379977a35f2831cc0ea24e9031525dcdd27df89609a20e
7
- data.tar.gz: 8fc4702997e582008a6ae01c6e884ca0b05153be79b6a9d54c96c86e7357ae1dc696c0ada33050246a6b06e68d8867293a523d71878eaf3a1f53cf8a6d3033fa
6
+ metadata.gz: c7113f8f6595db60a2d0a9046f8dac1d511cab2c2a3ecfc664fa780b8aaf7c5965a7c4b8990f817b24afd08bbc72c89ebedf2ab363df9d240b0c8fcc77f26ea2
7
+ data.tar.gz: dcea3d87308dbff74b862b55906bf991b8f65ea8619217b857500585ea29b041ee8a390129bcd75c056c3dff005ee8f987fc42f5066685b73a92cf3a567c854e
@@ -7,7 +7,8 @@ module HydraEditor
7
7
  include Hydra::Presenter
8
8
  included do
9
9
  class_attribute :required_fields
10
- delegate :errors, :to => :model
10
+ self.required_fields = []
11
+ delegate :errors, to: :model
11
12
  end
12
13
 
13
14
  def initialize(model)
@@ -27,7 +28,23 @@ module HydraEditor
27
28
  @attributes[key.to_s] = value
28
29
  end
29
30
 
31
+ class Validator < ActiveModel::Validations::PresenceValidator
32
+ def self.kind
33
+ :presence
34
+ end
35
+ end
36
+
30
37
  module ClassMethods
38
+ def validators_on(*attributes)
39
+ attributes.flat_map do |attribute|
40
+ if required_fields.include?(attribute)
41
+ [Validator.new(attributes: [attribute])]
42
+ else
43
+ []
44
+ end
45
+ end
46
+ end
47
+
31
48
  def model_attributes(form_params)
32
49
  clean_params = sanitize_params(form_params)
33
50
  terms.each do |key|
@@ -75,6 +75,7 @@ module Hydra
75
75
  # we delegate to the array accessor, because the array accessor is overridden in MultiForm
76
76
  # which is included by GenericFileEditForm
77
77
  terms.each do |term|
78
+ next if method_defined? term
78
79
  define_method term do
79
80
  self[term]
80
81
  end
@@ -1,3 +1,3 @@
1
1
  module HydraEditor
2
- VERSION = "1.0.0.rc4"
2
+ VERSION = "1.0.0"
3
3
  end
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.rc4
4
+ version: 1.0.0
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-21 00:00:00.000000000 Z
12
+ date: 2015-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -31,28 +31,28 @@ dependencies:
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 9.0.0.rc2
34
+ version: 9.0.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 9.0.0.rc2
41
+ version: 9.0.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: cancancan
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: '1.8'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '0'
55
+ version: '1.8'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: simple_form
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -71,114 +71,114 @@ dependencies:
71
71
  name: sqlite3
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0'
76
+ version: '1.3'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0'
83
+ version: '1.3'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rspec-rails
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: '3.1'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: '3.1'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: factory_girl_rails
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '4.2'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '0'
111
+ version: '4.2'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: capybara
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ">="
116
+ - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '0'
118
+ version: '2.4'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">="
123
+ - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: '0'
125
+ version: '2.4'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: devise
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ">="
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '0'
132
+ version: '3.4'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
137
+ - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '0'
139
+ version: '3.4'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: hydra-head
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">="
144
+ - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: 9.0.0.rc2
146
+ version: '9.0'
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ">="
151
+ - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: 9.0.0.rc2
153
+ version: '9.0'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: engine_cart
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - ">="
158
+ - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: '0'
160
+ version: '0.5'
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - ">="
165
+ - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: '0'
167
+ version: '0.5'
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: jettywrapper
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: '1.8'
174
+ version: '2.0'
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: '1.8'
181
+ version: '2.0'
182
182
  description: A basic metadata editor for hydra-head
183
183
  email:
184
184
  - hydra-tech@googlegroups.com
@@ -232,9 +232,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
232
232
  version: '0'
233
233
  required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  requirements:
235
- - - ">"
235
+ - - ">="
236
236
  - !ruby/object:Gem::Version
237
- version: 1.3.1
237
+ version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
240
  rubygems_version: 2.2.2