change the path to files added in the content entries + ui settings are a hash not an object
This commit is contained in:
parent
3e3691ad4a
commit
05baecad0b
@ -16,9 +16,9 @@ module Locomotive
|
||||
current_site.content_types.ordered.only(:site_id, :name, :slug, :label_field_name).each_with_index do |content_type, index|
|
||||
next if !content_type.persisted?
|
||||
|
||||
if index >= Locomotive.config.ui.max_content_types
|
||||
if index >= Locomotive.config.ui[:max_content_types]
|
||||
if self.is_content_type_selected(content_type)
|
||||
others << visible.delete_at(Locomotive.config.ui.max_content_types - 1) # swap content types
|
||||
others << visible.delete_at(Locomotive.config.ui[:max_content_types] - 1) # swap content types
|
||||
visible.insert(0, content_type)
|
||||
else
|
||||
others << content_type # fills the "..." menu
|
||||
|
@ -30,7 +30,7 @@ module Locomotive
|
||||
|
||||
## named scopes ##
|
||||
scope :visible, :where => { :_visible => true }
|
||||
scope :latest_updated, :order_by => :updated_at.desc, :limit => Locomotive.config.ui.latest_entries_nb
|
||||
scope :latest_updated, :order_by => :updated_at.desc, :limit => Locomotive.config.ui[:latest_entries_nb]
|
||||
|
||||
## methods ##
|
||||
|
||||
|
@ -45,7 +45,7 @@ module Locomotive
|
||||
validates_exclusion_of :slug, :in => Locomotive.config.reserved_slugs, :if => Proc.new { |p| p.depth <= 1 }
|
||||
|
||||
## named scopes ##
|
||||
scope :latest_updated, :order_by => [[:updated_at, :desc]], :limit => Locomotive.config.ui.latest_entries_nb
|
||||
scope :latest_updated, :order_by => [[:updated_at, :desc]], :limit => Locomotive.config.ui[:latest_entries_nb]
|
||||
scope :root, :where => { :slug => 'index', :depth => 0 }
|
||||
scope :not_found, :where => { :slug => '404', :depth => 0 }
|
||||
scope :published, :where => { :published => true }
|
||||
|
@ -26,7 +26,7 @@ module CustomFields
|
||||
|
||||
# Set correct paths
|
||||
def store_dir
|
||||
"sites/#{model.site_id}/contents/#{model.class.model_name.underscore}/#{model.id}/files"
|
||||
"sites/#{model.site_id}/content_#{model.class.model_name.demodulize.underscore}/#{model.id}/files"
|
||||
end
|
||||
|
||||
def cache_dir
|
||||
|
Loading…
Reference in New Issue
Block a user