driftrock-service 0.4.8 → 0.4.9
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.
@@ -27,12 +27,6 @@ module Driftrock::Service::DriftrockModel
|
|
27
27
|
:adwords, :conversion].each do |channel|
|
28
28
|
define_method("has_#{channel}_channel?") do
|
29
29
|
channel_type = channel.to_s
|
30
|
-
if channel == :adwords
|
31
|
-
channel_type = "google_adwords"
|
32
|
-
end
|
33
|
-
if channel == :conversion
|
34
|
-
channel_type = "google_analytics"
|
35
|
-
end
|
36
30
|
has_channel?(channel_type)
|
37
31
|
end
|
38
32
|
end
|
@@ -43,7 +37,14 @@ module Driftrock::Service::DriftrockModel
|
|
43
37
|
end
|
44
38
|
|
45
39
|
def channel_by_type(channel_type)
|
46
|
-
channels.find do |channel|
|
40
|
+
channels.find do |channel|
|
41
|
+
channel_type = channel_type.to_s
|
42
|
+
if channel_type == "adwords"
|
43
|
+
channel_type = "google_adwords"
|
44
|
+
end
|
45
|
+
if channel_type == "conversion"
|
46
|
+
channel_type = "google_analytics"
|
47
|
+
end
|
47
48
|
channel.channel_type.name == channel_type
|
48
49
|
end
|
49
50
|
end
|