rails_admin_amoeba_dup 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +24 -0
- data/app/views/rails_admin/main/amoeba_dup.html.haml +3 -0
- data/config/initializers/amoeba_dup_actions.rb +20 -0
- data/config/locales/amoeba_dup.en.yml +11 -0
- data/config/locales/amoeba_dup.it.yml +11 -0
- data/lib/rails_admin_amoeba_dup/engine.rb +7 -0
- data/lib/rails_admin_amoeba_dup/version.rb +3 -0
- data/lib/rails_admin_amoeba_dup.rb +48 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 57e24f4c717fdf0c10db1bc76f8fde94f00ce1c6
|
4
|
+
data.tar.gz: f2821add053fdf5eb7963d7b31d3d96b2ace318f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 55f92fd68f8d24aa550dd58045e0629173b0a3bc0408f26c5068b3be07f28afacb54c2f4e6c66aded98c931f6ede1e32aa78f3edffaaa3f8594df29fe1e8e291
|
7
|
+
data.tar.gz: 04bfe675e14077f244a73c907c883e8dd55d28b6f6c201a59a2cd0d1e755ad4e22dc7d2f6f843adc7088aa3bd450ee3e2d0e6028c85d6292b7396a594299ba65
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 Gabriele Tassoni
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'RailsAdminAmoebaDup'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
load 'rails/tasks/statistics.rake'
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
Bundler::GemHelper.install_tasks
|
24
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# begin
|
2
|
+
# mod = Required::Module::const_get "TheCoreActions"
|
3
|
+
# #It exists
|
4
|
+
#
|
5
|
+
# rescue NameError
|
6
|
+
# #Doesn't exist
|
7
|
+
# Rails.logger.debug "TheCoreActions not exists, cannot module_eval it please add the action to rails_admin.rb initializer."
|
8
|
+
# end
|
9
|
+
|
10
|
+
RailsAdmin.config do |config|
|
11
|
+
config.actions do
|
12
|
+
amoeba_dup
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# TheCoreActions.module_eval do
|
17
|
+
# def amoeba_dup_actions
|
18
|
+
# amoeba_dup
|
19
|
+
# end
|
20
|
+
# end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require "rails_admin_amoeba_dup/engine"
|
2
|
+
|
3
|
+
module RailsAdminAmoebaDup
|
4
|
+
end
|
5
|
+
|
6
|
+
require 'rails_admin/config/actions'
|
7
|
+
|
8
|
+
module RailsAdmin
|
9
|
+
module Config
|
10
|
+
module Actions
|
11
|
+
class AmoebaDup < Base
|
12
|
+
RailsAdmin::Config::Actions.register(self)
|
13
|
+
|
14
|
+
register_instance_option :object_level do
|
15
|
+
true
|
16
|
+
end
|
17
|
+
|
18
|
+
# This ensures the action only shows up for Users
|
19
|
+
register_instance_option :visible? do
|
20
|
+
# visible only if authorized and if the object has a defined method
|
21
|
+
(authorized? && bindings[:object].class.amoeba.enabled) rescue false
|
22
|
+
end
|
23
|
+
|
24
|
+
# You may or may not want pjax for your action
|
25
|
+
register_instance_option :pjax? do
|
26
|
+
false
|
27
|
+
end
|
28
|
+
|
29
|
+
register_instance_option :member do
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
33
|
+
register_instance_option :controller do
|
34
|
+
Proc.new do
|
35
|
+
copy = @object.amoeba_dup
|
36
|
+
copy.save
|
37
|
+
|
38
|
+
redirect_to back_or_index
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
register_instance_option :link_icon do
|
43
|
+
'icon-copy fa fa-files-o'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_admin_amoeba_dup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gabriele Tassoni
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thecore
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: amoeba
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.1'
|
41
|
+
description: Only for the models you set as enabled, this plugin adds a member action
|
42
|
+
that allows for deep configurable cloning of records.
|
43
|
+
email:
|
44
|
+
- gabrieletassoni@taris.it
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- MIT-LICENSE
|
50
|
+
- Rakefile
|
51
|
+
- app/views/rails_admin/main/amoeba_dup.html.haml
|
52
|
+
- config/initializers/amoeba_dup_actions.rb
|
53
|
+
- config/locales/amoeba_dup.en.yml
|
54
|
+
- config/locales/amoeba_dup.it.yml
|
55
|
+
- lib/rails_admin_amoeba_dup.rb
|
56
|
+
- lib/rails_admin_amoeba_dup/engine.rb
|
57
|
+
- lib/rails_admin_amoeba_dup/version.rb
|
58
|
+
homepage: https://www.taris.it
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.6.14
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Deep clone of records for rails_admin.
|
82
|
+
test_files: []
|