bhf 1.0.0.beta13 → 1.0.0.beta14
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/Gemfile.lock +26 -22
- data/VERSION +1 -1
- data/app/controllers/bhf/embed_entries_controller.rb +1 -1
- data/app/controllers/bhf/entries_controller.rb +1 -1
- data/bhf.gemspec +3 -3
- data/lib/bhf/mongoid/document.rb +17 -16
- 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: aa23a6a3284743aad862e06a3619bf82680d4d051d45aacad70bd73cf476a0cd
|
|
4
|
+
data.tar.gz: aebcd4ae9555ac9d07704e893f2e3e94512cf9ca3f80c5c5621e20d226ae1452
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 036cee8f048b04ae530b9499ae4b053f253c54cbc1e5389cdee138234f891b2c2610af569e327c7058ba40e3e1ca2439feeb1ecb7e279cb77ce9caf57f080982
|
|
7
|
+
data.tar.gz: 15ee9ef860a1f76b9405ad3ec58cf4f0bf453313c544840d24a32784dfa71b0792a50d60f9d5e597f2ad90215645db57ab111c78934fdaaaac7aee247c8b74e4
|
data/Gemfile.lock
CHANGED
|
@@ -58,8 +58,8 @@ GEM
|
|
|
58
58
|
zeitwerk (~> 2.2)
|
|
59
59
|
addressable (2.4.0)
|
|
60
60
|
builder (3.2.4)
|
|
61
|
-
concurrent-ruby (1.1.
|
|
62
|
-
crass (1.0.
|
|
61
|
+
concurrent-ruby (1.1.6)
|
|
62
|
+
crass (1.0.6)
|
|
63
63
|
descendants_tracker (0.0.4)
|
|
64
64
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
65
65
|
docile (1.3.2)
|
|
@@ -94,7 +94,7 @@ GEM
|
|
|
94
94
|
haml (>= 4.0, < 6)
|
|
95
95
|
nokogiri (>= 1.6.0)
|
|
96
96
|
ruby_parser (~> 3.5)
|
|
97
|
-
i18n (1.
|
|
97
|
+
i18n (1.8.3)
|
|
98
98
|
concurrent-ruby (~> 1.0)
|
|
99
99
|
jeweler (2.3.9)
|
|
100
100
|
builder
|
|
@@ -109,19 +109,19 @@ GEM
|
|
|
109
109
|
semver2
|
|
110
110
|
json (2.3.0)
|
|
111
111
|
jwt (2.2.1)
|
|
112
|
-
kaminari (1.
|
|
112
|
+
kaminari (1.2.1)
|
|
113
113
|
activesupport (>= 4.1.0)
|
|
114
|
-
kaminari-actionview (= 1.
|
|
115
|
-
kaminari-activerecord (= 1.
|
|
116
|
-
kaminari-core (= 1.
|
|
117
|
-
kaminari-actionview (1.
|
|
114
|
+
kaminari-actionview (= 1.2.1)
|
|
115
|
+
kaminari-activerecord (= 1.2.1)
|
|
116
|
+
kaminari-core (= 1.2.1)
|
|
117
|
+
kaminari-actionview (1.2.1)
|
|
118
118
|
actionview
|
|
119
|
-
kaminari-core (= 1.
|
|
120
|
-
kaminari-activerecord (1.
|
|
119
|
+
kaminari-core (= 1.2.1)
|
|
120
|
+
kaminari-activerecord (1.2.1)
|
|
121
121
|
activerecord
|
|
122
|
-
kaminari-core (= 1.
|
|
123
|
-
kaminari-core (1.
|
|
124
|
-
loofah (2.
|
|
122
|
+
kaminari-core (= 1.2.1)
|
|
123
|
+
kaminari-core (1.2.1)
|
|
124
|
+
loofah (2.6.0)
|
|
125
125
|
crass (~> 1.0.2)
|
|
126
126
|
nokogiri (>= 1.5.9)
|
|
127
127
|
mail (2.7.1)
|
|
@@ -130,16 +130,19 @@ GEM
|
|
|
130
130
|
mimemagic (~> 0.3.2)
|
|
131
131
|
method_source (0.9.2)
|
|
132
132
|
mime-types (2.99.3)
|
|
133
|
-
mimemagic (0.3.
|
|
133
|
+
mimemagic (0.3.10)
|
|
134
|
+
nokogiri (~> 1)
|
|
135
|
+
rake
|
|
134
136
|
mini_mime (1.0.2)
|
|
135
|
-
mini_portile2 (2.
|
|
136
|
-
minitest (5.
|
|
137
|
+
mini_portile2 (2.5.0)
|
|
138
|
+
minitest (5.14.1)
|
|
137
139
|
multi_json (1.14.1)
|
|
138
140
|
multi_xml (0.6.0)
|
|
139
141
|
multipart-post (2.1.1)
|
|
140
142
|
nio4r (2.5.2)
|
|
141
|
-
nokogiri (1.
|
|
142
|
-
mini_portile2 (~> 2.
|
|
143
|
+
nokogiri (1.11.2)
|
|
144
|
+
mini_portile2 (~> 2.5.0)
|
|
145
|
+
racc (~> 1.4)
|
|
143
146
|
oauth2 (1.4.2)
|
|
144
147
|
faraday (>= 0.8, < 2.0)
|
|
145
148
|
jwt (>= 1.0, < 3.0)
|
|
@@ -147,7 +150,8 @@ GEM
|
|
|
147
150
|
multi_xml (~> 0.5)
|
|
148
151
|
rack (>= 1.2, < 3)
|
|
149
152
|
psych (3.1.0)
|
|
150
|
-
|
|
153
|
+
racc (1.5.2)
|
|
154
|
+
rack (2.2.3)
|
|
151
155
|
rack-test (1.1.0)
|
|
152
156
|
rack (>= 1.0, < 3)
|
|
153
157
|
rails (6.0.2.1)
|
|
@@ -217,12 +221,12 @@ GEM
|
|
|
217
221
|
turbolinks (5.2.1)
|
|
218
222
|
turbolinks-source (~> 5.2)
|
|
219
223
|
turbolinks-source (5.2.0)
|
|
220
|
-
tzinfo (1.2.
|
|
224
|
+
tzinfo (1.2.7)
|
|
221
225
|
thread_safe (~> 0.1)
|
|
222
226
|
websocket-driver (0.7.1)
|
|
223
227
|
websocket-extensions (>= 0.1.0)
|
|
224
|
-
websocket-extensions (0.1.
|
|
225
|
-
zeitwerk (2.
|
|
228
|
+
websocket-extensions (0.1.5)
|
|
229
|
+
zeitwerk (2.4.0)
|
|
226
230
|
|
|
227
231
|
PLATFORMS
|
|
228
232
|
ruby
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.0.
|
|
1
|
+
1.0.0.beta14
|
|
@@ -53,7 +53,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
|
53
53
|
render file: 'public/404.html', layout: false and return unless @object
|
|
54
54
|
|
|
55
55
|
before_save
|
|
56
|
-
if @object.
|
|
56
|
+
if @object.update(@permited_params)
|
|
57
57
|
manage_relations
|
|
58
58
|
after_save
|
|
59
59
|
|
data/bhf.gemspec
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: bhf 1.0.0.
|
|
5
|
+
# stub: bhf 1.0.0.beta14 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "bhf".freeze
|
|
9
|
-
s.version = "1.0.0.
|
|
9
|
+
s.version = "1.0.0.beta14"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1".freeze) if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib".freeze]
|
|
13
13
|
s.authors = ["Anton Pawlik".freeze]
|
|
14
|
-
s.date = "
|
|
14
|
+
s.date = "2021-03-31"
|
|
15
15
|
s.description = "A simple to use Rails-Engine-Gem that offers an admin interface for trusted user. Easy integratable and highly configurable and agnostic. Works with ActiveRecord and Mongoid.".freeze
|
|
16
16
|
s.email = "anton.pawlik@gmail.com".freeze
|
|
17
17
|
s.extra_rdoc_files = [
|
data/lib/bhf/mongoid/document.rb
CHANGED
|
@@ -20,18 +20,19 @@ module Bhf::Mongoid
|
|
|
20
20
|
@name = mongoid_field.name
|
|
21
21
|
@klass = mongoid_field.class_name.constantize
|
|
22
22
|
@foreign_key = mongoid_field.key
|
|
23
|
-
@macro =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
@macro = mongoid_field.class.name.demodulize.underscore.to_sym
|
|
24
|
+
# @macro = case mongoid_field.macro
|
|
25
|
+
# when :references_and_referenced_in_many
|
|
26
|
+
# :has_and_belongs_to_many
|
|
27
|
+
# when :references_many
|
|
28
|
+
# :has_many
|
|
29
|
+
# when :references_one
|
|
30
|
+
# :has_one
|
|
31
|
+
# when :referenced_in
|
|
32
|
+
# :belongs_to
|
|
33
|
+
# else
|
|
34
|
+
# mongoid_field.macro
|
|
35
|
+
# end
|
|
35
36
|
end
|
|
36
37
|
end
|
|
37
38
|
|
|
@@ -67,7 +68,7 @@ module Bhf::Mongoid
|
|
|
67
68
|
def reflections
|
|
68
69
|
c = {}
|
|
69
70
|
relations.each do |key, meta|
|
|
70
|
-
next if meta.
|
|
71
|
+
next if meta.is_a?(Mongoid::Association::Embedded::EmbeddedIn)
|
|
71
72
|
c[key] = Reflection.new(meta)
|
|
72
73
|
end
|
|
73
74
|
c
|
|
@@ -112,7 +113,7 @@ module Bhf::Mongoid
|
|
|
112
113
|
|
|
113
114
|
def get_embedded_parent(parent_id, &block)
|
|
114
115
|
relations.each do |key, meta|
|
|
115
|
-
next unless meta.
|
|
116
|
+
next unless meta.is_a?(Mongoid::Association::Embedded::EmbeddedIn)
|
|
116
117
|
parent = meta.class_name.constantize
|
|
117
118
|
parent = parent.find(parent_id) rescue nil
|
|
118
119
|
|
|
@@ -130,7 +131,7 @@ module Bhf::Mongoid
|
|
|
130
131
|
else
|
|
131
132
|
meta.inverse_foreign_key.pluralize
|
|
132
133
|
end.to_s
|
|
133
|
-
if parent.relations[key_name] and parent.relations[key_name].
|
|
134
|
+
if parent.relations[key_name] and parent.relations[key_name].is_a?(Mongoid::Association::Embedded::EmbedsOne)
|
|
134
135
|
parent.send("build_#{key_name}", params)
|
|
135
136
|
else
|
|
136
137
|
parent.send(key_name).build(params)
|
|
@@ -146,7 +147,7 @@ module Bhf::Mongoid
|
|
|
146
147
|
meta.inverse_foreign_key.pluralize
|
|
147
148
|
end.to_s
|
|
148
149
|
relation = parent.send(key_name)
|
|
149
|
-
if parent.relations[key_name].
|
|
150
|
+
if parent.relations[key_name].is_a?(Mongoid::Association::Embedded::EmbedsOne)
|
|
150
151
|
relation
|
|
151
152
|
else
|
|
152
153
|
relation.find(ref_id)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bhf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.
|
|
4
|
+
version: 1.0.0.beta14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anton Pawlik
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|