syrup_form_object 0.0.9 → 0.0.10

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.
@@ -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
- def create_record
68
- run_callbacks(:create) {save_form}
69
- end
60
+ if Rails::VERSION::MAJOR >= 4
70
61
 
71
- def update_record
72
- run_callbacks(:update) {save_form}
73
- end
62
+ def create_record
63
+ run_callbacks(:create) {save_form}
64
+ end
74
65
 
75
- def create
76
- run_callbacks(:create) { save_form }
77
- end
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
- def update
80
- run_callbacks(:update) { save_form }
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
@@ -1,3 +1,3 @@
1
1
  module Syrup
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
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.9
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-20 00:00:00.000000000 Z
12
+ date: 2013-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: virtus