File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,11 +42,16 @@ def change(callback)
4242 else
4343 run_callbacks is_new? ? :create : :update do
4444 @changing = true
45+ result = nil
4546 run_callbacks callback do
46- yield
47+ result = yield
4748 end
4849
49- save if @save_needed || is_new?
50+ if @save_needed || is_new?
51+ save
52+ else
53+ return result
54+ end
5055 end
5156 end
5257 end
@@ -118,7 +123,8 @@ def _save
118123
119124 saved = @model . save
120125 @save_needed = !saved
121- saved
126+
127+ return :default
122128 end
123129
124130 def _remove
@@ -139,13 +145,17 @@ def _create_has_many_links(association_type, association_key_values)
139145 raise JSONAPI ::Exceptions ::HasManyRelationExists . new ( association_key_value )
140146 end
141147 end
148+
149+ return :default
142150 end
143151
144152 def _replace_has_many_links ( association_type , association_key_values )
145153 association = self . class . _associations [ association_type ]
146154
147155 send ( "#{ association . foreign_key } =" , association_key_values )
148156 @save_needed = true
157+
158+ return :default
149159 end
150160
151161 def _replace_has_one_link ( association_type , association_key_value )
@@ -159,6 +169,8 @@ def _remove_has_many_link(association_type, key)
159169 association = self . class . _associations [ association_type ]
160170
161171 @model . send ( association . type ) . delete ( key )
172+
173+ return :default
162174 end
163175
164176 def _remove_has_one_link ( association_type )
You can’t perform that action at this time.
0 commit comments