rails_admin_draft 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/README.md +1 -1
- data/app/views/rails_admin/main/edit.html.erb +4 -1
- data/config/locales/rails_admin_draft/en.yml +1 -0
- data/config/locales/rails_admin_draft/fr.yml +1 -0
- data/lib/rails_admin_draft/concern/draft_concern.rb +2 -2
- data/lib/rails_admin_draft/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96122c2d58423d2a963678b8fc06a923ff234f9ca7b6b038901acca099c8993e
|
4
|
+
data.tar.gz: 6a5557f4e8dbb370ed79553fde57e65c1421583c82e9a6ea19ebb45ae6d3b061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ada57b779764918b92cfc142d926935e6efd74bae1f5987cd4c440d32ae0e89769d82000c401749e5243e5c216e7f031fa996861e7a90f6fff53d3a9d65f229f
|
7
|
+
data.tar.gz: 5aeb25e7a722359a25133bd8656fd7d0e3104f854c4e4cc159e6918d4af96eedd3fa013eda69e556e0c67c450a5bb0c88a6baee43d84749d162fef772ee2c978
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
<% if @draft_conf.draft? && @object.is_draft? %>
|
2
2
|
<div class="alert alert-dark">
|
3
|
-
<b><%=I18n.t('admin.form.draft_header')%></b>
|
3
|
+
<b><%= I18n.t('admin.form.draft_header') %></b>
|
4
|
+
<% if @object.draft_source_id.present? %>
|
5
|
+
<%= I18n.t('admin.form.of' )%> <%= link_to "#{@object.class.name} ID:1", edit_path(@abstract_model, @object.draft_source_id) %>
|
6
|
+
<% end %>
|
4
7
|
</div>
|
5
8
|
<% end %>
|
6
9
|
|
@@ -98,8 +98,8 @@ module DraftConcern
|
|
98
98
|
|
99
99
|
class_methods do
|
100
100
|
# Creates bi-directional association for draft source.
|
101
|
-
def
|
102
|
-
association_class_name =
|
101
|
+
def has_draft
|
102
|
+
association_class_name = self.name.to_s
|
103
103
|
class_eval do
|
104
104
|
has_one :draft, class_name: "#{association_class_name}", foreign_key: :draft_source_id, inverse_of: :draft_source
|
105
105
|
belongs_to :draft_source, class_name: "#{association_class_name}", optional: true
|