Merge pull request #409 from waynegerard/label_field_name
Added a setter method for label_field_id in content_types.rb model
This commit is contained in:
commit
415817e20b
@ -83,6 +83,13 @@ module Locomotive
|
|||||||
def class_name_to_content_type(class_name)
|
def class_name_to_content_type(class_name)
|
||||||
self.class.class_name_to_content_type(class_name, self.site)
|
self.class.class_name_to_content_type(class_name, self.site)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def label_field_id=(value)
|
||||||
|
# update the label_field_name if the label_field_id is changed
|
||||||
|
new_label_field_name = self.entries_custom_fields.where(:_id =>value).first.try(:name)
|
||||||
|
self.label_field_name = new_label_field_name
|
||||||
|
super(value)
|
||||||
|
end
|
||||||
|
|
||||||
def label_field_name=(value)
|
def label_field_name=(value)
|
||||||
# mandatory if we allow the API to set the label field name without an id of the field
|
# mandatory if we allow the API to set the label field name without an id of the field
|
||||||
|
Loading…
Reference in New Issue
Block a user