populate-me 0.0.31 → 0.0.32
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/lib/populate_me/mongo/crushyform.rb +1 -1
- data/lib/populate_me/mongo/mutation.rb +7 -2
- data/lib/populate_me/mongo/stash.rb +2 -0
- data/populate-me.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c06dba10c3a16aaecd4bff9aa43dd9b85be0253c0f5456a69dd05c6a8d22d9ae
|
4
|
+
data.tar.gz: e8b380b450715787fcc60e1d69181cc1d98bed44be5d5a064c2856f481f8e18f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0905a6876cd39098d7c30fc86f5604abf64d8a75086b267c8b05b098d8f60e4b023461c0a9718ecd5f3f0f46c610437cc7e2ba9f83bd411172344050e331b05c'
|
7
|
+
data.tar.gz: ebe75ce21a787a0ba8bec25665089a3b9e5217e88e768f937cabf038b74353b885c6d09a4b6769a65da630f79fc35524eaf76751bcf79299b692f98751e61cde
|
@@ -76,7 +76,7 @@ module PopulateMe
|
|
76
76
|
end,
|
77
77
|
:attachment => proc do |m,c,o|
|
78
78
|
deleter = "<input type='checkbox' name='#{o[:input_name]}' class='deleter' value='nil' /> Delete this file<br />" unless m.doc[c].nil?
|
79
|
-
"%s
|
79
|
+
"%s<input type='file' name='%s' id='%s' class='%s' />%s %s\n" % [m.to_thumb(c), o[:input_name], m.field_id_for(c), o[:input_class], o[:required], deleter]
|
80
80
|
end,
|
81
81
|
:select => proc do |m,c,o|
|
82
82
|
# starter ensures it sends something when multiple is empty
|
@@ -194,7 +194,12 @@ module PopulateMe
|
|
194
194
|
|
195
195
|
# saving and hooks
|
196
196
|
def new?; @is_new ||= !@doc.key?('_id'); end
|
197
|
-
def update_doc(fields)
|
197
|
+
def update_doc(fields)
|
198
|
+
@old_doc = @doc.dup
|
199
|
+
@doc.update(fields)
|
200
|
+
@is_new = false
|
201
|
+
self
|
202
|
+
end
|
198
203
|
# Getter and setter in one
|
199
204
|
def errors_on(col,message=nil)
|
200
205
|
message.nil? ? @errors[col] : @errors[col] = (@errors[col]||[]) << message
|
@@ -219,7 +224,7 @@ module PopulateMe
|
|
219
224
|
next unless model.schema.key?(k)
|
220
225
|
type = k=='_id' ? :primary_key : model.schema[k][:type]
|
221
226
|
fix_method = "fix_type_#{type}"
|
222
|
-
if v==''
|
227
|
+
if v=='' and type!=:attachment
|
223
228
|
default = model.schema[k][:default]
|
224
229
|
@doc[k] = default.is_a?(Proc) ? default.call : default
|
225
230
|
else
|
data/populate-me.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'populate-me'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.32'
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.summary = "ALPHA !!! Populate Me is relatively complete but simple CMS"
|
6
6
|
s.description = "ALPHA !!! Populate Me is relatively complete but simple CMS. It includes a Rack middleware for putting in your Rack stack, and a bespoke MongoDB ODM. But Populate Me is not really finished yet."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: populate-me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickael Riga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack-golem
|