File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ class TranslatePage
1616 def call
1717 return nil unless page . persisted?
1818
19- translate_page !
19+ translate_all !
2020 end
2121
22- private
22+ protected
2323
2424 def site
2525 @site ||= fetch_site . call
@@ -29,18 +29,20 @@ def theme
2929 @theme ||= fetch_theme . call
3030 end
3131
32- protected
33-
34- def translate_page!
32+ def translate_all!
3533 translate_page_attributes
3634 translate_all_sections
3735
36+ persist_changes!
37+
38+ page
39+ end
40+
41+ def persist_changes!
3842 ActiveRecord ::Base . transaction do
3943 site . save!
4044 page . save!
4145 end
42-
43- page
4446 end
4547
4648 def translate_page_attributes
@@ -119,12 +121,4 @@ def clone_array(array)
119121 Marshal . load ( Marshal . dump ( array || [ ] ) )
120122 end
121123 end
122-
123- # def theme
124- # @theme ||= fetch_theme.call
125- # end
126-
127- # def site
128- # @site ||= fetch_site.call
129- # end
130124end
You can’t perform that action at this time.
0 commit comments