solve a bug on has_ony / has_many caused by the caching mechanism
This commit is contained in:
parent
7f9a62b0f4
commit
8f36f5a2d8
@ -53,6 +53,14 @@ class ContentInstance
|
||||
Hash.new.replace(self.errors)
|
||||
end
|
||||
|
||||
def reload_parent!
|
||||
self.class.reload_parent!
|
||||
end
|
||||
|
||||
def self.reload_parent!
|
||||
self._parent = self._parent.reload
|
||||
end
|
||||
|
||||
def to_liquid
|
||||
Locomotive::Liquid::Drops::Content.new(self)
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
- field.target.constantize.reload_parent! # to make sure all the contents from the parent are loaded
|
||||
|
||||
= form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'has-many' do
|
||||
|
||||
.has-many-selector
|
||||
|
@ -1,2 +1,4 @@
|
||||
- field.target.constantize.reload_parent! # to make sure all the contents from the parent are loaded
|
||||
|
||||
= form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :input_html => { :class => 'has_one' }, :as => :select, :collection => options_for_has_one(field), :selected => form.object.send(field._alias.to_sym).try(:_id)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user