tramway-partner 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tramway/partner/scopes.rb +17 -0
- data/lib/tramway/partner/version.rb +1 -1
- data/lib/tramway/partner.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6082a154190dbfc7b870c641e5048c8cfff042b2612220dc17e9364c3c1487f1
|
4
|
+
data.tar.gz: e53b84b0a40f4c4acdb1590da5c1e364af8aa25a1e216c617c45ef5db67505ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2371b270b2d736d3b00b0adbc947241064383ab80877fe2be18195f9c76a78da361381ee817dd748cd71c001c0a0912045d488f210268b434d7a9e9916ea48b1
|
7
|
+
data.tar.gz: 75fe2f90fe5be3452bd3732d9c24f568b7f75eafe1ce698ed54b7e9e429a9a327e6f0753b0066c87f8bdd754644ce993aec7e60a6402acab394f7f5b235487d1
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Tramway::Partner::Scopes
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
included do
|
5
|
+
::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
|
6
|
+
define_method partnership_type.pluralize.to_sym do
|
7
|
+
query = <<-SQL
|
8
|
+
tramway_partner_partnerships.partnership_type = '#{partnership_type}'
|
9
|
+
AND tramway_partner_partnerships.partner_id = '#{id}'
|
10
|
+
AND tramway_partner_partnerships.state = 'active'
|
11
|
+
AND tramway_partner_partnerships.partner_type = '#{self.class.name}'
|
12
|
+
SQL
|
13
|
+
Tramway::Partner::Organization.joins(:partnerships).where(query)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/tramway/partner.rb
CHANGED
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.
|
4
|
+
version: 1.0.3
|
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: 2019-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for partners
|
14
14
|
email:
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- lib/tramway/partner/generators/install_generator.rb
|
46
46
|
- lib/tramway/partner/generators/templates/create_tramway_partner_organizations.rb
|
47
47
|
- lib/tramway/partner/generators/templates/create_tramway_partner_partnerships.rb
|
48
|
+
- lib/tramway/partner/scopes.rb
|
48
49
|
- lib/tramway/partner/version.rb
|
49
50
|
homepage: https://github.com/ulmic/tramway-partner
|
50
51
|
licenses:
|