populate-me 0.1.1 → 0.1.2
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/example/config.ru +1 -1
- data/lib/populate_me/document_mixins/admin_adapter.rb +3 -3
- data/lib/populate_me/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf39cbd436ac3c25feec8dc07c8dfeda08cd3b19
|
|
4
|
+
data.tar.gz: e4b006749ef14117de6f9f880ca28b4fb86fd399
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b295d3b3a38ce22d97e6e299669aa0f2378d1e923fd7c274d27275eb63b884cdcf4cf7e60f5a020278e523d1d1e145caff54ab3b062ddf35f81b033b9e2f7aa9
|
|
7
|
+
data.tar.gz: 1d675a3d630d6a144a5907b23e649c1ddd61086b57c42cb8014ccb745922212e4cc403ab7dfe413e7153aa04fcdcf20520e0d2531ec586b0362a5e72833054d4
|
data/example/config.ru
CHANGED
|
@@ -26,7 +26,7 @@ class BlogPost < PopulateMe::Document
|
|
|
26
26
|
field :published, type: :boolean
|
|
27
27
|
relationship :comments
|
|
28
28
|
def validate
|
|
29
|
-
error_on(:content,'Cannot be blank') if
|
|
29
|
+
error_on(:content,'Cannot be blank') if WebUtils.blank?(self.content)
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
class BlogPost::Author < PopulateMe::Document
|
|
@@ -3,7 +3,7 @@ module PopulateMe
|
|
|
3
3
|
module AdminAdapter
|
|
4
4
|
|
|
5
5
|
def to_admin_url
|
|
6
|
-
"#{
|
|
6
|
+
"#{WebUtils.dasherize_class_name(self.class.name)}/#{id}".sub(/\/$/,'')
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def admin_image_url
|
|
@@ -23,7 +23,7 @@ module PopulateMe
|
|
|
23
23
|
unless v[:hidden]
|
|
24
24
|
out << {
|
|
25
25
|
title: "#{v[:label]}",
|
|
26
|
-
href: "#{o[:request].script_name}/list/#{
|
|
26
|
+
href: "#{o[:request].script_name}/list/#{WebUtils.dasherize_class_name(v[:class_name])}?filter[#{v[:foreign_key]}]=#{self.id}"
|
|
27
27
|
}
|
|
28
28
|
out
|
|
29
29
|
end
|
|
@@ -112,7 +112,7 @@ module PopulateMe
|
|
|
112
112
|
{
|
|
113
113
|
template: 'template_list',
|
|
114
114
|
page_title: self.to_s_short_plural,
|
|
115
|
-
dasherized_class_name:
|
|
115
|
+
dasherized_class_name: WebUtils.dasherize_class_name(self.name),
|
|
116
116
|
new_data: new_data,
|
|
117
117
|
sort_field: self.sort_field_for(o),
|
|
118
118
|
# 'command_plus'=> !self.populate_config[:no_plus],
|
data/lib/populate_me/version.rb
CHANGED
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.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mickael Riga
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-05-
|
|
11
|
+
date: 2017-05-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: web-utils
|