thecore_backend_commons 2.2.4 → 2.2.5
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/config/initializers/thecore_backend_commons_app_configs.rb +0 -2
- data/lib/concerns/thecore_backend_commons_user.rb +4 -2
- data/lib/patches/thecore.rb +6 -9
- data/lib/thecore_backend_commons/version.rb +1 -1
- data/lib/thecore_backend_commons.rb +3 -2
- metadata +2 -4
- data/lib/patches/thecore_rails_admin_bulk_delete_concern.rb +0 -16
- data/lib/patches/thecore_rails_admin_export_concern.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82149f563831770ec3f19bcd865462625a2cf8029312eeea7c3e25a9157960f3
|
4
|
+
data.tar.gz: e4cde439462a45b1f27d29a3cb60c0462c7a72d2ef8aa0d8b5064ca1b29a82f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e355b6924cd95c543b86032493219de14b615ed686f1e45c7899b8d3af3b47cd01fe512fcd7032135a715d5103bd4c3363e253d2afd0a4fd16f17519246a5971
|
7
|
+
data.tar.gz: 7056954496cecf46edfdf9eec29c7c8f70e81ab854795c94ef6c1dbda9a61f1302193a539b1dba2825efe90f2812904214b5bcac36408706a629c7fb929e36c6
|
@@ -22,8 +22,6 @@ Rails.application.configure do
|
|
22
22
|
ActiveRecord::Base.send(:include, ActiveRecordExtensions)
|
23
23
|
Integer.send(:include, FixnumConcern)
|
24
24
|
String.send(:include, StringConcern)
|
25
|
-
RailsAdmin::Config::Actions::Export.send(:include, ExportConcern)
|
26
|
-
RailsAdmin::Config::Actions::BulkDelete.send(:include, BulkDeleteConcern)
|
27
25
|
User.send(:include, ThecoreBackendCommonsUser)
|
28
26
|
end
|
29
27
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
1
3
|
module ThecoreBackendCommonsUser
|
2
4
|
extend ActiveSupport::Concern
|
3
5
|
|
4
6
|
included do
|
5
7
|
devise :rememberable
|
6
|
-
devise :trackable
|
7
|
-
devise :validatable
|
8
8
|
devise :timeoutable, timeout_in: 30.minutes
|
9
|
+
validates :username, uniqueness: { case_sensitive: false }, presence: true, length: { in: 4..15 }
|
10
|
+
validates_format_of :username, with: /\A[a-zA-Z0-9]*\z/, on: :create, message: "can only contain letters and digits"
|
9
11
|
end
|
10
12
|
end
|
data/lib/patches/thecore.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
|
-
require '
|
2
|
-
require 'thecore_rails_admin_bulk_delete_concern'
|
1
|
+
require 'patches/date_format'
|
3
2
|
|
4
|
-
require '
|
3
|
+
require 'patches/string_extensions'
|
4
|
+
require 'patches/integer_extensions'
|
5
|
+
require 'patches/active_record_extensions'
|
5
6
|
|
6
|
-
require '
|
7
|
-
require 'integer_extensions'
|
8
|
-
require 'active_record_extensions'
|
7
|
+
require 'patches/postgresql_drop_replacement'
|
9
8
|
|
10
|
-
require '
|
11
|
-
|
12
|
-
require 'application_record_loader'
|
9
|
+
require 'patches/application_record_loader'
|
@@ -1,11 +1,12 @@
|
|
1
|
-
require "thecore_backend_commons/engine"
|
2
|
-
|
3
1
|
require 'thecore_auth_commons'
|
4
2
|
require 'devise-i18n'
|
5
3
|
require 'http_accept_language'
|
6
4
|
require 'rails-i18n'
|
7
5
|
|
8
6
|
require 'patches/thecore'
|
7
|
+
require 'concerns/thecore_backend_commons_user'
|
8
|
+
|
9
|
+
require "thecore_backend_commons/engine"
|
9
10
|
|
10
11
|
module ThecoreBackendCommons
|
11
12
|
# Your code goes here...
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_backend_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_auth_commons
|
@@ -98,8 +98,6 @@ files:
|
|
98
98
|
- lib/patches/postgresql_drop_replacement.rb
|
99
99
|
- lib/patches/string_extensions.rb
|
100
100
|
- lib/patches/thecore.rb
|
101
|
-
- lib/patches/thecore_rails_admin_bulk_delete_concern.rb
|
102
|
-
- lib/patches/thecore_rails_admin_export_concern.rb
|
103
101
|
- lib/tasks/thecore_backend_commons_tasks.rake
|
104
102
|
- lib/thecore_backend_commons.rb
|
105
103
|
- lib/thecore_backend_commons/engine.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'active_support/concern'
|
2
|
-
|
3
|
-
module BulkDeleteConcern
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
included do
|
6
|
-
# Should the action be visible
|
7
|
-
# Edit By taris, it shows the button only if there are records displayed
|
8
|
-
register_instance_option :visible? do
|
9
|
-
# If not in index, then return true,
|
10
|
-
# otherwise it wont' be added to the list
|
11
|
-
# of all Actions during rails initialization
|
12
|
-
# In index, instead, I show it only if there are records in the current view
|
13
|
-
bindings[:controller].action_name == "index" ? (authorized? && !bindings[:controller].instance_variable_get("@objects").blank?) : true
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'active_support/concern'
|
2
|
-
|
3
|
-
module ExportConcern
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
included do
|
6
|
-
# Should the action be visible
|
7
|
-
# Edit By taris, it shows the button only if there are records displayed
|
8
|
-
register_instance_option :visible? do
|
9
|
-
# If not in index, then return true,
|
10
|
-
# otherwise it wont' be added to the list
|
11
|
-
# of all Actions during rails initialization
|
12
|
-
# In index, instead, I show it only if there are records in the current view
|
13
|
-
bindings[:controller].action_name == "index" ? (authorized? && !bindings[:controller].instance_variable_get("@objects").blank?) : true
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|