epom_rails 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epom_rails/acts_as.rb +10 -4
- data/lib/epom_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9487c632ee64b76623635a73c7ea0fa1ebc24142
|
4
|
+
data.tar.gz: 91b9485e01854440b99cbe9f7a029588f58ec1c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce6449077d706236c930d7566723159184ce90c42ff81ead03d8dfa94e8432f0afd8f63f1ed4ce4861640a442a7062f40994244ceabc02257bc0e7fe64ef01d4
|
7
|
+
data.tar.gz: 44efb423e734bd84f3f4ba87585af8bdfff2f5c9a70f59f24095315d77e3b9e284f031de862d3dd16d363cbb89c5cc87de4db455ff522a96c620f6770413085f
|
data/lib/epom_rails/acts_as.rb
CHANGED
@@ -46,15 +46,21 @@ class ActiveRecord::Base
|
|
46
46
|
method = if self.send fields.key('id') then "update_#{klass_name.downcase}" else "create_#{klass_name.downcase}" end
|
47
47
|
|
48
48
|
url_params = {}
|
49
|
-
|
50
|
-
|
49
|
+
url_parameters = klass.extended_methods[method.to_sym][:url_parameters]
|
50
|
+
if url_parameters
|
51
|
+
url_parameters.each do |parameter|
|
51
52
|
url_params[parameter] = self.send(fields.key(parameter.to_s)) if fields.key(parameter.to_s)
|
52
53
|
end
|
53
54
|
end
|
55
|
+
# if campaignId, bannerId, etc, as url parameters in update action
|
56
|
+
if url_parameters and url_parameters.include? "#{klass_name.downcase}Id".to_sym
|
57
|
+
url_params["#{klass_name.downcase}Id".to_sym] = self.send "#{fields.key('id')}"
|
58
|
+
end
|
54
59
|
|
55
60
|
body_params = {}
|
56
|
-
|
57
|
-
|
61
|
+
body_parameters = klass.extended_methods[method.to_sym][:body_parameters]
|
62
|
+
if body_parameters
|
63
|
+
body_parameters.each do |parameter|
|
58
64
|
body_params[parameter] = self.send(fields.key(parameter.to_s)) if fields.key(parameter.to_s)
|
59
65
|
end
|
60
66
|
end
|
data/lib/epom_rails/version.rb
CHANGED