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.
@@ -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
- my_scope = options[:scope] || :all
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
- .send(my_scope)
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
- .send(my_scope)
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.0 ruby lib
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.0"
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"]
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paid_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren