maktoub 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/maktoub.rb +4 -2
- data/lib/maktoub/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 783e746011efeeb2bb7251c621e120a21949f1ec
|
4
|
+
data.tar.gz: 07f9f8420d34a1b405fd64f50741b5988ecc470c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ce54f7aec552fb1ca32f7613cc532705820efa519eb2b98ac7eb635336a02c78c39ce37d87b2590b79854b0e18a52fad25abc96b6d8ce709045993aa0f7af32
|
7
|
+
data.tar.gz: 740af82b19fba46844d0b65fc82588ab257fb1e0aaaed371b6b4b2bea2ddd50f93887f59fffcebdddd4aad4be2ac5a9e331eb5485bba9200e9bb98e5b7e0a8c0
|
data/lib/maktoub.rb
CHANGED
@@ -32,9 +32,11 @@ module Maktoub
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def unsubscribe(email)
|
35
|
-
if subscribers.class.
|
36
|
-
subscribers.
|
35
|
+
if Maktoub.subscribers.class.parents.include?(ActiveRecord) #check if ActiveRecord relation
|
36
|
+
subscriber = subscribers.find_by(email_field => email)
|
37
|
+
subscriber.send(unsubscribe_method) if subscriber.present?
|
37
38
|
else
|
39
|
+
puts 'WARNING!!! Use ActiveRecord query methods to find subscribers. Falling back to iterating through subscribers array (slow!).'
|
38
40
|
subscribers.select do |s|
|
39
41
|
s.send(email_field) == email
|
40
42
|
end.each do |s|
|
data/lib/maktoub/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maktoub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaid Zawaideh
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-06-
|
12
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|