tramway-partner 1.0.3.1 → 1.0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -5
- data/app/controllers/tramway/partner/application_controller.rb +2 -0
- data/app/decorators/tramway/partner/organization_decorator.rb +3 -1
- data/app/decorators/tramway/partner/organization_feature_decorator.rb +2 -0
- data/app/decorators/tramway/partner/partnership_decorator.rb +4 -2
- data/app/forms/{tramway → admin/tramway}/partner/organization_form.rb +3 -1
- data/app/forms/{tramway → admin/tramway}/partner/partnership_form.rb +3 -1
- data/app/helpers/tramway/partner/application_helper.rb +2 -0
- data/app/jobs/tramway/partner/application_job.rb +2 -0
- data/app/mailers/tramway/partner/application_mailer.rb +2 -0
- data/app/models/tramway/partner/application_record.rb +2 -0
- data/app/models/tramway/partner/organization.rb +2 -0
- data/app/models/tramway/partner/partnership.rb +4 -2
- data/config/initializers/tramway.rb +4 -1
- data/config/routes.rb +2 -0
- data/lib/tasks/tramway/partner_tasks.rake +2 -0
- data/lib/tramway/partner.rb +3 -1
- data/lib/tramway/partner/engine.rb +2 -0
- data/lib/tramway/partner/generators/install_generator.rb +7 -6
- data/lib/tramway/partner/generators/templates/create_tramway_partner_organizations.rb +2 -0
- data/lib/tramway/partner/generators/templates/create_tramway_partner_partnerships.rb +2 -0
- data/lib/tramway/partner/scopes.rb +2 -0
- data/lib/tramway/partner/version.rb +3 -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: ac64c2bc4abff6fac9869d06caf159e48ca61c480be5b951b52695ed1fe59394
|
4
|
+
data.tar.gz: 5aefa2fdca2d80874eaa06990fe00131c9bbbed347a38f3444836a286b12de1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19803cbbc831c6f2bbf388fe27021affe442847c40ee0926cd828060b1aa5ee3d1e693c76f9a1ecc10f54736a9f396affcb907a74276aba009271ecb6acfa1b7
|
7
|
+
data.tar.gz: 754e429d0081a2ab7c2bb3c9d7411d7d64aff8f04cdc73187932c26d2a298341f583331f949c4a8e515feb06221125a4fb15f216edb6a993f3ad41bbe441c9ea
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
begin
|
2
4
|
require 'bundler/setup'
|
3
5
|
rescue LoadError
|
@@ -14,14 +16,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
17
|
end
|
16
18
|
|
17
|
-
APP_RAKEFILE = File.expand_path(
|
19
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
18
20
|
load 'rails/tasks/engine.rake'
|
19
21
|
|
20
|
-
|
21
22
|
load 'rails/tasks/statistics.rake'
|
22
23
|
|
23
|
-
|
24
|
-
|
25
24
|
require 'bundler/gem_tasks'
|
26
25
|
|
27
26
|
require 'rake/testtask'
|
@@ -32,5 +31,4 @@ Rake::TestTask.new(:test) do |t|
|
|
32
31
|
t.verbose = false
|
33
32
|
end
|
34
33
|
|
35
|
-
|
36
34
|
task default: :test
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::Partner::PartnershipDecorator < ::Tramway::Core::ApplicationDecorator
|
2
4
|
class << self
|
3
5
|
def collections
|
4
|
-
[
|
6
|
+
[:all]
|
5
7
|
end
|
6
8
|
end
|
7
|
-
|
9
|
+
|
8
10
|
def title
|
9
11
|
"#{object.organization.title} #{I18n.t("enumerize.tramway/partner/partnership.partnership_type.#{object.partnership_type}")} #{object.partner.title}"
|
10
12
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Admin::Tramway::Partner::PartnershipForm < ::Tramway::Core::ApplicationForm
|
2
4
|
properties :partner_id, :organization_id, :partnership_type, :partner_type
|
3
5
|
|
4
6
|
associations :partner, :organization
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::Partner::Partnership < ::Tramway::Core::ApplicationRecord
|
2
4
|
belongs_to :organization, class_name: 'Tramway::Partner::Organization'
|
3
5
|
belongs_to :partner, polymorphic: true
|
4
6
|
|
5
|
-
enumerize :partnership_type, in: [
|
6
|
-
enumerize :partner_type, in: [
|
7
|
+
enumerize :partnership_type, in: %i[organizator program support info], default: :organizator
|
8
|
+
enumerize :partner_type, in: ['Tramway::Event::Event', 'Tramway::Conference::Unity']
|
7
9
|
end
|
data/config/routes.rb
CHANGED
data/lib/tramway/partner.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails/generators'
|
2
4
|
require 'tramway/core/generators/install_generator'
|
3
5
|
|
4
6
|
module Tramway::Partner::Generators
|
5
7
|
class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
|
6
8
|
include Rails::Generators::Migration
|
7
|
-
source_root File.expand_path('
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
8
10
|
|
9
|
-
def run_other_generators
|
10
|
-
end
|
11
|
+
def run_other_generators; end
|
11
12
|
|
12
13
|
def self.next_migration_number(path)
|
13
14
|
next_migration_number = current_migration_number(path) + 1
|
@@ -15,9 +16,9 @@ module Tramway::Partner::Generators
|
|
15
16
|
end
|
16
17
|
|
17
18
|
def copy_migrations
|
18
|
-
migrations = [
|
19
|
-
|
20
|
-
|
19
|
+
migrations = %i[
|
20
|
+
create_tramway_partner_organizations
|
21
|
+
create_tramway_partner_partnerships
|
21
22
|
]
|
22
23
|
migrations.each do |migration|
|
23
24
|
migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-partner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.3.
|
4
|
+
version: 1.0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for partners
|
14
14
|
email:
|
@@ -27,8 +27,8 @@ files:
|
|
27
27
|
- app/decorators/tramway/partner/organization_decorator.rb
|
28
28
|
- app/decorators/tramway/partner/organization_feature_decorator.rb
|
29
29
|
- app/decorators/tramway/partner/partnership_decorator.rb
|
30
|
-
- app/forms/tramway/partner/organization_form.rb
|
31
|
-
- app/forms/tramway/partner/partnership_form.rb
|
30
|
+
- app/forms/admin/tramway/partner/organization_form.rb
|
31
|
+
- app/forms/admin/tramway/partner/partnership_form.rb
|
32
32
|
- app/helpers/tramway/partner/application_helper.rb
|
33
33
|
- app/jobs/tramway/partner/application_job.rb
|
34
34
|
- app/mailers/tramway/partner/application_mailer.rb
|