thecore_backend_commons 3.0.7 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a58eec9185a92cd2374ffe97eef0591e799f85a06896b9ddfa713ed3ed93b57e
4
- data.tar.gz: a00535d3478d071d65e725e11a440c931455185d8aed7f1225c40e56f3e1830c
3
+ metadata.gz: f945a5a988302320da13aacff1e60ac457bcfa90e821f7d2f3bd8c504814217f
4
+ data.tar.gz: 17f5d7df875584740df6e1445cec02bda7e8222cfe7e33586c5681c054baead5
5
5
  SHA512:
6
- metadata.gz: 07f1c0975d36defb3c7352224827b7accf735ad95d1ffd830510ace11e47ce081e7190a3bace763759f45c04f79d9ad27798579da34c24c969fe07aca5561f81
7
- data.tar.gz: a2efa54a92e6f41e4d446408130b43690312a6d9d016716126f4cb2ae8b9517584ad5916a5945e8c335feb4260aeb69f398d183840f764f499e51215ae353278
6
+ metadata.gz: 045c8bebc2f8cfca9427e90955a5a6d0651f9a36b808fe848121699bf41e0495af70c14f6baa2e0ca9c07c5880085e60522be7225c3057b23eaff093315fbe03
7
+ data.tar.gz: '025857799451bfa92eb226751bc2605510e600ba1e605bfbcefdba4c772a1e754b06285ed3dd0942845c1667be25b928e816b00fead8719c85a57c2c3f55de04'
@@ -0,0 +1,16 @@
1
+ class ActivityLogChannel < ApplicationCable::Channel
2
+ def subscribed
3
+ stream_from "messages"
4
+ end
5
+
6
+ def unsubscribed
7
+ # Any cleanup needed when channel is unsubscribed
8
+ end
9
+
10
+ # https://cableready.stimulusreflex.com/troubleshooting/#verify-actioncable
11
+
12
+ def receive(data)
13
+ puts data["message"]
14
+ ActionCable.server.broadcast("messages", "ActionCable is connected")
15
+ end
16
+ end
@@ -1,6 +1,8 @@
1
1
  Rails.application.configure do
2
+
2
3
  config.after_initialize do
3
4
  Integer.send(:include, FixnumConcern)
4
5
  String.send(:include, StringConcern)
6
+ ApplicationCable::Connection.send(:include, CableConnectionConcern)
5
7
  end
6
8
  end
@@ -0,0 +1,22 @@
1
+ require 'active_support/concern'
2
+
3
+ module CableConnectionConcern
4
+ extend ActiveSupport::Concern
5
+ included do
6
+ identified_by :current_user
7
+
8
+ def connect
9
+ self.current_user = find_verified_user
10
+ end
11
+
12
+ protected
13
+
14
+ def find_verified_user # this checks whether a user is authenticated with devise
15
+ if verified_user = env['warden'].user
16
+ verified_user
17
+ else
18
+ reject_unauthorized_connection
19
+ end
20
+ end
21
+ end
22
+ end
@@ -5,6 +5,9 @@ require 'devise-i18n'
5
5
  require 'http_accept_language'
6
6
  require "roo"
7
7
  require "roo-xls"
8
+ require "active_storage_validations"
9
+ require 'ulid'
10
+
8
11
  require "thecore_backend_commons/engine"
9
12
 
10
13
  module ThecoreBackendCommons
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: 3.0.7
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-11 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_auth_commons
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: active_storage_validations
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: ulid
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.3'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.3'
111
139
  description: Wrapper to keep all the common libraries and setups needed by Thecore
112
140
  UI Backend(s).
113
141
  email:
@@ -118,10 +146,12 @@ extra_rdoc_files: []
118
146
  files:
119
147
  - README.md
120
148
  - Rakefile
149
+ - app/channels/activity_log_channel.rb
121
150
  - config/initializers/abilities.rb
122
151
  - config/initializers/add_to_db_migrations.rb
123
152
  - config/initializers/after_initialize.rb
124
153
  - config/initializers/application_config.rb
154
+ - config/initializers/concern_cable_connection.rb
125
155
  - config/initializers/concern_integer.rb
126
156
  - config/initializers/concern_string.rb
127
157
  - config/initializers/extension_nil.rb