paid_up 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +157 -948
- data/lib/paid_up/mixins/paid_for.rb +7 -9
- data/paid_up.gemspec +2 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +1 -1
@@ -8,8 +8,12 @@ module PaidUp
|
|
8
8
|
PaidUp::Feature.find_by_slug(table_name)
|
9
9
|
end
|
10
10
|
|
11
|
+
def paid_for_scope
|
12
|
+
send(@scope)
|
13
|
+
end
|
14
|
+
|
11
15
|
def paid_for(options = {})
|
12
|
-
|
16
|
+
@scope = options[:scope] || :all
|
13
17
|
feature.nil? && raise(
|
14
18
|
:feature_not_found_feature.l(feature: table_name)
|
15
19
|
)
|
@@ -30,12 +34,6 @@ module PaidUp
|
|
30
34
|
)
|
31
35
|
end
|
32
36
|
|
33
|
-
singleton_class.instance_eval do
|
34
|
-
send(:define_method, :paid_for_scope) do
|
35
|
-
send(my_scope)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
37
|
send(:define_method, :owners) do
|
40
38
|
case self.class.feature.setting_type
|
41
39
|
when 'table_rows'
|
@@ -69,12 +67,12 @@ module PaidUp
|
|
69
67
|
case self.class.feature.setting_type
|
70
68
|
when 'table_rows'
|
71
69
|
ids += subscriber.send(self.class.table_name)
|
72
|
-
.
|
70
|
+
.paid_for_scope
|
73
71
|
.pluck(:id)
|
74
72
|
when 'rolify_rows'
|
75
73
|
ids += self.class
|
76
74
|
.with_role(:owner, subscriber)
|
77
|
-
.
|
75
|
+
.paid_for_scope
|
78
76
|
.pluck(:id)
|
79
77
|
else
|
80
78
|
raise(
|
data/paid_up.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: paid_up 0.11.
|
5
|
+
# stub: paid_up 0.11.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "paid_up"
|
9
|
-
s.version = "0.11.
|
9
|
+
s.version = "0.11.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|