diff --git a/lib/locomotive/mounter/models/content_field.rb b/lib/locomotive/mounter/models/content_field.rb index 2eb8b9c..e728d8e 100644 --- a/lib/locomotive/mounter/models/content_field.rb +++ b/lib/locomotive/mounter/models/content_field.rb @@ -7,12 +7,13 @@ class ContentField < Base ## fields ## field :label field :name - field :type, default: :string + field :type, default: :string field :hint - field :position, default: 0 - field :required, default: false - field :unique, default: false - field :localized, default: false + field :position, default: 0 + field :required, default: false + field :unique, default: false + field :localized, default: false + field :searchable, default: false # text field :text_formatting @@ -110,7 +111,7 @@ def find_select_option(name_or_id) # @return [ Hash ] The params # def to_params - params = self.filter_attributes %w(label name type hint position required localized unique) + params = self.filter_attributes %w(label name type hint position required localized unique searchable) # we set the _id / _destroy attributes for embedded documents params[:_id] = self._id if self.persisted? @@ -186,4 +187,4 @@ def select_options_to_hash end end -end \ No newline at end of file +end diff --git a/spec/unit/models/content_field_spec.rb b/spec/unit/models/content_field_spec.rb index 187011e..ad3750e 100644 --- a/spec/unit/models/content_field_spec.rb +++ b/spec/unit/models/content_field_spec.rb @@ -38,6 +38,10 @@ build_content_field(type: 'date').type.should == :date end + it 'has searchable which should default to false' do + build_content_field.searchable.should == false + end + end describe '.is_relationship?' do @@ -93,4 +97,4 @@ def build_options(names) end end -end \ No newline at end of file +end