syrup_form_object 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/syrup/form_object.rb +14 -19
- data/lib/syrup/version.rb +1 -1
- metadata +2 -2
data/lib/syrup/form_object.rb
CHANGED
@@ -45,13 +45,6 @@ class Syrup::FormObject
|
|
45
45
|
self.save
|
46
46
|
end
|
47
47
|
|
48
|
-
# def attributes=(params)
|
49
|
-
# @params = params
|
50
|
-
# params.each do |key, value|
|
51
|
-
# self.send "#{key}=", value
|
52
|
-
# end
|
53
|
-
# end
|
54
|
-
|
55
48
|
def build(params); end
|
56
49
|
def after_find(params); end
|
57
50
|
|
@@ -64,21 +57,23 @@ class Syrup::FormObject
|
|
64
57
|
end
|
65
58
|
end
|
66
59
|
|
67
|
-
|
68
|
-
run_callbacks(:create) {save_form}
|
69
|
-
end
|
60
|
+
if Rails::VERSION::MAJOR >= 4
|
70
61
|
|
71
|
-
|
72
|
-
|
73
|
-
|
62
|
+
def create_record
|
63
|
+
run_callbacks(:create) {save_form}
|
64
|
+
end
|
74
65
|
|
75
|
-
|
76
|
-
|
77
|
-
|
66
|
+
def update_record(attributes=[])
|
67
|
+
run_callbacks(:update) {save_form}
|
68
|
+
end
|
69
|
+
else
|
70
|
+
def create
|
71
|
+
run_callbacks(:create) { save_form }
|
72
|
+
end
|
78
73
|
|
79
|
-
|
80
|
-
|
74
|
+
def update(attributes=[])
|
75
|
+
run_callbacks(:update) { save_form }
|
76
|
+
end
|
81
77
|
end
|
82
78
|
|
83
|
-
|
84
79
|
end
|
data/lib/syrup/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syrup_form_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: virtus
|