tramway-profiles 1.3.2.4 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/decorators/tramway/profiles/social_network_decorator.rb +4 -0
- data/app/forms/admin/tramway/profiles/social_network_form.rb +4 -3
- data/app/models/tramway/profiles/social_network.rb +1 -3
- data/config/locales/{models.yml → profiles_models.yml} +0 -0
- data/lib/tramway/profiles.rb +9 -2
- data/lib/tramway/profiles/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4abc89d7e1d959a2d620f9eb4e2e63f3c78d78d07ec5f683f09d102fbb60d1de
|
4
|
+
data.tar.gz: cb64a595639fdc3283b247eb7f62e3d9378d31029168b3a8089546c477961f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1c0649aa8e3da815ab87c4cbffa8730aff7455a4b56cfaa54c1374edbdf0d224626de1646ae59517905851cc714f53f6ae1fe2d17e4d6e7e7886af3e8548dc9
|
7
|
+
data.tar.gz: f8c9e89541ae6617b022a9a44daaea72860368433f7e37f204a999b9585c80470b43851dca947dfd9a3fe53c95f3cda81fcd758b7288e577fbb7a0bc4fae61ea
|
data/README.md
CHANGED
@@ -27,6 +27,8 @@ rails db:migrate
|
|
27
27
|
::Tramway::Admin.set_available_models(::Tramway::Profiles::SocialNetwork, project: :your_project_name)
|
28
28
|
```
|
29
29
|
|
30
|
+
#### 5. Now you have SocialNetwork objects in your project, that associated with [Tramway::Core.application](https://github.com/ulmic/tramway-dev/tree/develop/tramway-core#how-to-create-model-that-will-be-an-application-model-for-the-tramway) by default
|
31
|
+
|
30
32
|
## Usage. English
|
31
33
|
|
32
34
|
...coming soon
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Admin::Tramway::Profiles::SocialNetworkForm < ::Tramway::Core::ApplicationForm
|
4
|
-
properties :title, :network_name, :
|
4
|
+
properties :title, :network_name, :uid, :record_id, :record_type
|
5
|
+
|
6
|
+
association :record
|
5
7
|
|
6
8
|
def initialize(object)
|
7
9
|
super(object).tap do
|
8
10
|
form_properties title: :string,
|
9
11
|
network_name: :default,
|
10
12
|
uid: :string,
|
11
|
-
|
12
|
-
record_id: :integer
|
13
|
+
record: :polymorphic_association
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -4,7 +4,5 @@ class Tramway::Profiles::SocialNetwork < ::Tramway::Core::ApplicationRecord
|
|
4
4
|
belongs_to :record, polymorphic: true, required: false
|
5
5
|
|
6
6
|
enumerize :network_name, in: %i[vk facebook twitter instagram telegram patreon]
|
7
|
-
enumerize :record_type, in:
|
8
|
-
type if const_defined?(type)
|
9
|
-
end + [Tramway::Core.application_object.try(:model_class) || Tramway::Core.application_object]).compact
|
7
|
+
enumerize :record_type, in: Tramway::Profiles.records
|
10
8
|
end
|
File without changes
|
data/lib/tramway/profiles.rb
CHANGED
@@ -6,9 +6,16 @@ require 'tramway/profiles/generates/install_generator'
|
|
6
6
|
module Tramway
|
7
7
|
module Profiles
|
8
8
|
class << self
|
9
|
-
|
9
|
+
def records=(*models)
|
10
|
+
@@records ||= []
|
11
|
+
@@records += (models.map do |model|
|
12
|
+
model.to_s.sub(/^\:\:/, '')
|
13
|
+
end)
|
14
|
+
end
|
10
15
|
|
11
|
-
|
16
|
+
def records
|
17
|
+
defined?(@@records) ? @@records.uniq : []
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
14
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-profiles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for social networks profiles
|
14
14
|
email:
|
@@ -32,7 +32,7 @@ files:
|
|
32
32
|
- app/models/tramway/profiles/social_network.rb
|
33
33
|
- app/views/layouts/tramway/profiles/application.html.erb
|
34
34
|
- config/initializers/tramway.rb
|
35
|
-
- config/locales/
|
35
|
+
- config/locales/profiles_models.yml
|
36
36
|
- config/routes.rb
|
37
37
|
- lib/tasks/tramway/profiles_tasks.rake
|
38
38
|
- lib/tramway/profiles.rb
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
|
-
rubygems_version: 3.
|
62
|
+
rubygems_version: 3.1.2
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: Rails engine for social networks profiles
|