From 868c2d2e0e83d461e5cadcf485bd61f77c141185 Mon Sep 17 00:00:00 2001 From: Corey Woodcox Date: Fri, 20 Jan 2012 18:18:53 -0700 Subject: [PATCH 1/8] upgrade devise to 1.5.x --- Gemfile | 2 +- Gemfile.lock | 14 +++++++------- locomotive_cms.gemspec | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index cb7c8a3b..4c454140 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'rake', '0.9.2' gem 'rails', '3.0.10' gem 'warden' -gem 'devise', '1.3.4' +gem 'devise', '~>1.5.0' gem 'devise_bushido_authenticatable', '1.0.0.alpha10', :require => 'devise_cas_authenticatable' gem 'mongo', '~> 1.3.1' diff --git a/Gemfile.lock b/Gemfile.lock index 9b2ad00f..0a3ae90a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,7 +41,7 @@ GEM arel (2.0.10) autotest (4.4.6) ZenTest (>= 4.4.1) - bcrypt-ruby (2.1.4) + bcrypt-ruby (3.0.1) bson (1.3.1) bson_ext (1.3.1) builder (2.1.2) @@ -89,10 +89,10 @@ GEM delayed_job_mongoid (1.0.8) delayed_job (~> 3.0.0) mongoid (>= 2.0) - devise (1.3.4) - bcrypt-ruby (~> 2.1.2) + devise (1.5.3) + bcrypt-ruby (~> 3.0) orm_adapter (~> 0.0.3) - warden (~> 1.0.3) + warden (~> 1.1) devise_bushido_authenticatable (1.0.0.alpha10) devise devise (>= 1.0.6) @@ -179,7 +179,7 @@ GEM net-ssh (2.2.2) nokogiri (1.5.0) open4 (1.3.0) - orm_adapter (0.0.5) + orm_adapter (0.0.6) pickle (0.4.10) cucumber (>= 0.8) rake @@ -270,7 +270,7 @@ GEM kgio (~> 2.4) rack raindrops (~> 0.6) - warden (1.0.6) + warden (1.1.0) rack (>= 1.0) xpath (0.1.4) nokogiri (~> 1.3) @@ -298,7 +298,7 @@ DEPENDENCIES custom_fields (= 1.0.0.beta.25) database_cleaner delayed_job_mongoid (= 1.0.8) - devise (= 1.3.4) + devise (~> 1.5.0) devise_bushido_authenticatable (= 1.0.0.alpha10) dragonfly (~> 0.9.1) factory_girl_rails (~> 1.3.0) diff --git a/locomotive_cms.gemspec b/locomotive_cms.gemspec index 8fbef388..89aeb8be 100644 --- a/locomotive_cms.gemspec +++ b/locomotive_cms.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_dependency 'rails', '~> 3.0.10' s.add_dependency 'warden' - s.add_dependency 'devise', '1.3.4' + s.add_dependency 'devise', '~>1.5.0' s.add_dependency 'devise_bushido_authenticatable', '1.0.0.alpha10' s.add_dependency 'mongo', '~> 1.3.1' From 34f9755d9accbfae0f4852f986f20e7c8eb4bb91 Mon Sep 17 00:00:00 2001 From: Mario Visic Date: Sat, 21 Jan 2012 15:10:58 +1100 Subject: [PATCH 2/8] Altered admin menu cells inheritence, fixes #257 without limiting cells version. --- Gemfile | 2 +- Gemfile.lock | 6 +++--- app/cells/admin/menu_cell.rb | 2 +- locomotive_cms.gemspec | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index cb7c8a3b..c92708b7 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,7 @@ gem 'delayed_job_mongoid', '1.0.8' gem 'rubyzip' gem 'locomotive_jammit-s3', :require => 'jammit-s3' gem 'SystemTimer', :platforms => :ruby_18 -gem 'cells', '~> 3.7.0' +gem 'cells' gem 'sanitize' gem 'highline' diff --git a/Gemfile.lock b/Gemfile.lock index 9b2ad00f..45daad4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,7 +62,7 @@ GEM xpath (~> 0.1.4) carrierwave (0.5.6) activesupport (~> 3.0) - cells (3.7.1) + cells (3.8.0) actionpack (~> 3.0) railties (~> 3.0) childprocess (0.2.5) @@ -141,7 +141,7 @@ GEM responders (~> 0.6.0) jammit (0.6.5) yui-compressor (>= 0.9.3) - json (1.6.4) + json (1.6.5) kaminari (0.13.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) @@ -293,7 +293,7 @@ DEPENDENCIES cancan capybara carrierwave (= 0.5.6) - cells (~> 3.7.0) + cells cucumber-rails (= 1.2.0) custom_fields (= 1.0.0.beta.25) database_cleaner diff --git a/app/cells/admin/menu_cell.rb b/app/cells/admin/menu_cell.rb index 1d6c920b..573b37bf 100644 --- a/app/cells/admin/menu_cell.rb +++ b/app/cells/admin/menu_cell.rb @@ -1,4 +1,4 @@ -class Admin::MenuCell < Cell::Base +class Admin::MenuCell < Cell::Rails include ::Rails.application.routes.url_helpers diff --git a/locomotive_cms.gemspec b/locomotive_cms.gemspec index 8fbef388..8af17b35 100644 --- a/locomotive_cms.gemspec +++ b/locomotive_cms.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |s| s.add_dependency 'locomotive_liquid', '2.2.2' s.add_dependency 'formtastic', '~> 1.2.3' s.add_dependency 'inherited_resources', '~> 1.1.2' - s.add_dependency 'cells', '~> 3.7.0' + s.add_dependency 'cells' s.add_dependency 'highline' s.add_dependency 'sanitize' From 40c2902e80b8b5a0f86a222b2167c75ca152f510 Mon Sep 17 00:00:00 2001 From: Mario Visic Date: Sat, 21 Jan 2012 15:51:16 +1100 Subject: [PATCH 3/8] Added shoulda matchers. --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index 803f0044..22df4b19 100644 --- a/Gemfile +++ b/Gemfile @@ -73,6 +73,7 @@ group :test do gem 'xpath', '~> 0.1.4' gem 'capybara' gem 'database_cleaner' + gem 'shoulda-matchers' gem 'spork', '~> 0.9.0.rc' gem 'launchy' diff --git a/Gemfile.lock b/Gemfile.lock index 68185e82..6d24b445 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -259,6 +259,7 @@ GEM ffi (~> 1.0.9) multi_json (~> 1.0.4) rubyzip + shoulda-matchers (1.0.0) spork (0.9.0.rc9) term-ansicolor (1.0.7) thor (0.14.6) @@ -332,6 +333,7 @@ DEPENDENCIES rubyzip sanitize sass (= 3.1.2) + shoulda-matchers spork (~> 0.9.0.rc) unicorn warden From 07ff99e1357b4b42db4cc3048035aec1ebdbaabd Mon Sep 17 00:00:00 2001 From: Mario Visic Date: Sat, 21 Jan 2012 15:51:38 +1100 Subject: [PATCH 4/8] Ensure uniqueness and format of an accounts email address. --- spec/models/account_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index c8f429a8..991a4fe0 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -1,20 +1,20 @@ require 'spec_helper' describe Account do + let!(:existing_account) { Factory(:account, :email => 'another@email.com') } it 'should have a valid factory' do FactoryGirl.build(:account).should be_valid end ## Validations ## - - %w{name email password}.each do |attr| - it "should validate presence of #{attr}" do - account = FactoryGirl.build(:account, attr.to_sym => nil) - account.should_not be_valid - account.errors[attr.to_sym].should include("can't be blank") - end - end + it { should validate_presence_of :name } + it { should validate_presence_of :email } + it { should validate_presence_of :password } + it { should validate_uniqueness_of(:email).with_message(/is already taken/) } + it { should allow_value('valid@email.com').for(:email) } + it { should allow_value('prefix+suffix@email.com').for(:email) } + it { should_not allow_value('not-an-email').for(:email) } it "should have a default locale" do account = Account.new From d665a855912a77e676955cb411b05c6f48bed2e7 Mon Sep 17 00:00:00 2001 From: Gil Vandendriessche Date: Tue, 17 Jan 2012 11:24:54 +0100 Subject: [PATCH 5/8] Add sample option on import rake task --- lib/tasks/locomotive.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/locomotive.rake b/lib/tasks/locomotive.rake index a36f5a70..2182ec2c 100644 --- a/lib/tasks/locomotive.rake +++ b/lib/tasks/locomotive.rake @@ -31,7 +31,7 @@ namespace :locomotive do desc 'Import a remote template described by its URL -- 2 options: SITE=name or id, RESET=by default false' task :import => :environment do - url, site_name_or_id, reset = ENV['URL'], ENV['SITE'], Boolean.set(ENV['RESET']) || false + url, site_name_or_id, samples, reset = ENV['URL'], ENV['SITE'], (Boolean.set(ENV['SAMPLES']) || false), (Boolean.set(ENV['RESET']) || false) if url.blank? || (url =~ /https?:\/\//).nil? raise "URL is missing or it is not a valid http url." @@ -43,9 +43,10 @@ namespace :locomotive do raise "No site found. Please give a correct value (name or id) for the SITE env variable." end - ::Locomotive::Import::Job.run!(url, site, { :samples => true, :reset => reset }) + ::Locomotive::Import::Job.run!(url, site, { :samples => samples, :reset => reset }) end + desc 'Add a new admin user (NOTE: currently only supports adding user to first site)' task :add_admin => :environment do name = ask('Display name: ') { |q| q.echo = true } From 81db1da4238ba2baf277efb96a869422aabd15f9 Mon Sep 17 00:00:00 2001 From: Corey Woodcox Date: Wed, 18 Jan 2012 18:30:12 -0700 Subject: [PATCH 6/8] fix spelling error in locales --- app/helpers/admin/content_types_helper.rb | 2 +- app/models/content_instance.rb | 2 +- app/models/page.rb | 2 +- app/views/admin/shared/menu/_contents.html.haml | 4 ++-- config/initializers/locomotive.rb | 2 +- config/locales/admin_ui.de.yml | 4 ++-- config/locales/admin_ui.en.yml | 4 ++-- config/locales/admin_ui.es.yml | 4 ++-- config/locales/admin_ui.fr.yml | 4 ++-- config/locales/admin_ui.it.yml | 4 ++-- config/locales/admin_ui.nl.yml | 4 ++-- config/locales/admin_ui.no.yml | 4 ++-- config/locales/admin_ui.pt-BR.yml | 4 ++-- config/locales/admin_ui.ru.yml | 4 ++-- lib/generators/locomotive/install/templates/locomotive.rb | 2 +- lib/locomotive/configuration.rb | 2 +- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/helpers/admin/content_types_helper.rb b/app/helpers/admin/content_types_helper.rb index 377fb024..bd6b5f58 100644 --- a/app/helpers/admin/content_types_helper.rb +++ b/app/helpers/admin/content_types_helper.rb @@ -6,7 +6,7 @@ module Admin::ContentTypesHelper return @content_types if @content_types @content_types = current_site.content_types.ordered. - limit(:contents => Locomotive.config.lastest_items_nb). + limit(:contents => Locomotive.config.latest_items_nb). only(:site_id, :name, :slug, :highlighted_field_name, :content_custom_fields_version, :order_by, :serialized_item_template, :raw_item_template).to_a if @content_type && @content_type.persisted? && @content_types.index(@content_type) >= MAX_DISPLAYED_CONTENTS diff --git a/app/models/content_instance.rb b/app/models/content_instance.rb index 2486522b..fb506cb3 100644 --- a/app/models/content_instance.rb +++ b/app/models/content_instance.rb @@ -26,7 +26,7 @@ class ContentInstance after_create :send_notifications ## named scopes ## - scope :latest_updated, :order_by => :updated_at.desc, :limit => Locomotive.config.lastest_items_nb + scope :latest_updated, :order_by => :updated_at.desc, :limit => Locomotive.config.latest_items_nb ## methods ## diff --git a/app/models/page.rb b/app/models/page.rb index 733e3358..56901ed9 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -40,7 +40,7 @@ class Page validates_exclusion_of :slug, :in => Locomotive.config.reserved_slugs, :if => Proc.new { |p| p.depth == 0 } ## named scopes ## - scope :latest_updated, :order_by => [[:updated_at, :desc]], :limit => Locomotive.config.lastest_items_nb + scope :latest_updated, :order_by => [[:updated_at, :desc]], :limit => Locomotive.config.latest_items_nb scope :root, :where => { :slug => 'index', :depth => 0 } scope :not_found, :where => { :slug => '404', :depth => 0 } scope :published, :where => { :published => true } diff --git a/app/views/admin/shared/menu/_contents.html.haml b/app/views/admin/shared/menu/_contents.html.haml index 51dff9e2..a3882028 100644 --- a/app/views/admin/shared/menu/_contents.html.haml +++ b/app/views/admin/shared/menu/_contents.html.haml @@ -3,7 +3,7 @@ .header %p= link_to t('admin.pages.index.new'), new_admin_page_url .inner - %h2!= t('admin.pages.index.lastest_items') + %h2!= t('admin.pages.index.latest_items') %ul - current_site.pages.latest_updated.minimal_attributes.each do |page| %li @@ -18,7 +18,7 @@ %p.edit= link_to t('admin.contents.index.edit'), edit_admin_content_type_url(content_type) .inner - %h2!= t('admin.contents.index.lastest_items') + %h2!= t('admin.contents.index.latest_items') %ul - content_type.latest_updated_contents.each do |content| %li diff --git a/config/initializers/locomotive.rb b/config/initializers/locomotive.rb index c61fb70d..18a0119d 100644 --- a/config/initializers/locomotive.rb +++ b/config/initializers/locomotive.rb @@ -46,7 +46,7 @@ Locomotive.configure do |config| config.delayed_job = false # configure how many items we display in sub menu in the "Contents" section. - # config.lastest_items_nb = 5 + # config.latest_items_nb = 5 # default locale (for now, only en, de, fr, pt-BR and it are supported) config.default_locale = :en diff --git a/config/locales/admin_ui.de.yml b/config/locales/admin_ui.de.yml index fd582635..bef2dc17 100644 --- a/config/locales/admin_ui.de.yml +++ b/config/locales/admin_ui.de.yml @@ -101,7 +101,7 @@ de: help: "Seiten sind als Baum organisiert. Du kannst die Seiten also wie Ordner sortieren und verschachteln." no_items: "Momentan gibt es keine Seiten. Klicke einfach hier, um die erste Seite zu erstellen." new: neue Seite - lastest_items: Neueste Seiten + latest_items: Neueste Seiten new: title: Neue Seite help: "Fülle das folgende Formular aus, um eine neue Seite zu erstellen. Nur zur Info: Die Seite wird nicht standardmäßig publiziert!" @@ -244,7 +244,7 @@ de: download: Elemente herunterladen new: neues Element category_noname: "Kein Name" - lastest_items: "Neueste Elemente" + latest_items: "Neueste Elemente" updated_at: "Aktualisiert am" list: no_items: "Momentan gibt es keine Elemente. Klicke einfach hier, um das erste Element zu erstellen." diff --git a/config/locales/admin_ui.en.yml b/config/locales/admin_ui.en.yml index 511461d4..2f0d66db 100644 --- a/config/locales/admin_ui.en.yml +++ b/config/locales/admin_ui.en.yml @@ -101,7 +101,7 @@ en: help: "Pages are organized as a tree. You can order pages as well as folders" no_items: "There are no pages for now. Just click here to create the first one." new: new page - lastest_items: Lastest pages + latest_items: Latest pages new: title: New page help: "Please fill in the below form to create your page. Be careful, by default, the page is not published." @@ -245,7 +245,7 @@ en: download: download items new: new item category_noname: "No name" - lastest_items: "Lastest items" + latest_items: "Lastest items" updated_at: "Updated at" list: no_items: "There are no items for now. Just click here to create the first one." diff --git a/config/locales/admin_ui.es.yml b/config/locales/admin_ui.es.yml index 656a5675..7c136c37 100644 --- a/config/locales/admin_ui.es.yml +++ b/config/locales/admin_ui.es.yml @@ -99,7 +99,7 @@ es: no_items: "No se ha creado ninguna página aún. Pulse aquí to para crear la primera." new: Nueva página - lastest_items: Últimas páginas + latest_items: Últimas páginas new: title: Nueva página help: "Por favor rellene el formulario de más abajo para crear su página. ¡Atención! Las páginas, por defecto, están 'no publicadas'." @@ -244,7 +244,7 @@ es: download: descargar elementos new: nuevo elemento category_noname: "Sin nombre" - lastest_items: "Últimos elementos" + latest_items: "Últimos elementos" updated_at: "Última actualización" list: no_items: "No hay ningún elemento. Haga click aquí para crear el primero." diff --git a/config/locales/admin_ui.fr.yml b/config/locales/admin_ui.fr.yml index 067f4398..123d66b1 100644 --- a/config/locales/admin_ui.fr.yml +++ b/config/locales/admin_ui.fr.yml @@ -101,7 +101,7 @@ fr: help: "Les pages sont organisées sous forme d'un arbre. Vous pouvez classes les pages ainsi que les dossiers." no_items: "Il n'existe pas de page. Vous pouvez commencer par créer une ici." new: nouvelle page - lastest_items: Dernières pages + latest_items: Dernières pages new: title: Nouvelle page help: "Remplissez le formulaire ci-dessous pour créer votre page. Attention, par défaut, la page n'est pas publiée." @@ -248,7 +248,7 @@ fr: download: télécharger éléments new: nouvel élément category_noname: "Pas de nom" - lastest_items: "Eléments récents" + latest_items: "Eléments récents" updated_at: "Mis à jour le" list: no_items: "Il n'existe pas d'éléments. Vous pouvez commencer par créer un ici" diff --git a/config/locales/admin_ui.it.yml b/config/locales/admin_ui.it.yml index a03dc757..46a6a575 100644 --- a/config/locales/admin_ui.it.yml +++ b/config/locales/admin_ui.it.yml @@ -99,7 +99,7 @@ it: help: "Le pagine sono organizzate ad albero. Puoi ordinarle come se fossero delle cartelle" no_items: "Per ora non ci sono pagine. Clicca qui per creare la prima pagina." new: nuova pagina - lastest_items: Ultime pagine + latest_items: Ultime pagine new: title: Nuova pagina help: "Prego, compila il seguente modulo per creare la tua pagina. Fai attenzione, per default, la pagina non è pubblicata." @@ -243,7 +243,7 @@ it: download: scarica elementi new: nuovo elemento category_noname: "Senza nome" - lastest_items: "Ultimi elementi" + latest_items: "Ultimi elementi" updated_at: "modificato il" list: no_items: "Per ora non ci sono elementi. Clicca qui per creare il primo." diff --git a/config/locales/admin_ui.nl.yml b/config/locales/admin_ui.nl.yml index 15dcc3a0..c8843ca6 100644 --- a/config/locales/admin_ui.nl.yml +++ b/config/locales/admin_ui.nl.yml @@ -91,7 +91,7 @@ nl: help: "Pagina's zijn georganiseerd als een boom. U kunt zowel pagina's als mappen ordenen" no_items: "Er zijn momenteel geen pagina's. Klik hier om de eerste pagina te maken." new: Nieuwe pagina - lastest_items: Laatste pagina's + latest_items: Laatste pagina's new: title: Nieuwe pagina help: "Voer onderstaande formulier in om uw pagina te maken. Opgelet, de pagina is niet gepubliseerd" @@ -227,7 +227,7 @@ nl: download: download items new: nieuw item category_noname: "Geen naam" - lastest_items: "Laatste items" + latest_items: "Laatste items" updated_at: "Gewijzigd op" list: no_items: "Er zijn momenteel geen items. Klik hier here om de eerste te maken." diff --git a/config/locales/admin_ui.no.yml b/config/locales/admin_ui.no.yml index 3e6ac46d..696b0f88 100644 --- a/config/locales/admin_ui.no.yml +++ b/config/locales/admin_ui.no.yml @@ -101,7 +101,7 @@ help: "Sidene er organisert i en trestruktur. Du kan sortere både sider og mapper." no_items: "Det har ikke blitt opprettet noen sider ennå. Klikk her for lage den første." new: ny side - lastest_items: Siste sider + latest_items: Siste sider new: title: Ny side help: "Fyll ut skjemaet nedenfor for å opprette en ny side. Publisering er skrudd av som standard." @@ -245,7 +245,7 @@ download: last ned elementer new: nytt element category_noname: "Navn mangler" - lastest_items: "Siste elementer" + latest_items: "Siste elementer" updated_at: "Sist oppdatert" list: no_items: "Det har ikke blitt opprettet noen elementer her ennå. Klikk her for å opprette det første." diff --git a/config/locales/admin_ui.pt-BR.yml b/config/locales/admin_ui.pt-BR.yml index 267806d9..f3684336 100644 --- a/config/locales/admin_ui.pt-BR.yml +++ b/config/locales/admin_ui.pt-BR.yml @@ -90,7 +90,7 @@ pt-BR: help: "As páginas são organizadas como uma árvore. Você pode reordenar as páginas como se fossem pastas" no_items: "Não existe nenhuma página ainda. Clique aqui para criar a primeira." new: nova página - lastest_items: Últmas páginas + latest_items: Últmas páginas new: title: Nova página help: "Por favor, preencha o formulário a seguir para criar sua página. Atenção: Por padrão a página não é publicada." @@ -223,7 +223,7 @@ pt-BR: download: download dos itens new: novo item category_noname: "Sem nome" - lastest_items: "Últimos itens" + latest_items: "Últimos itens" updated_at: "Atualizado em" list: no_items: "Não existem itens ainda. Clique aqui para criar o primeiro." diff --git a/config/locales/admin_ui.ru.yml b/config/locales/admin_ui.ru.yml index 8ec013c5..1aac8328 100644 --- a/config/locales/admin_ui.ru.yml +++ b/config/locales/admin_ui.ru.yml @@ -101,7 +101,7 @@ ru: help: "Страницы организованы в виде дерева. Вы можете сортировать как страницы, так и папки" no_items: "There are no pages for now. Just click here to create the first one." new: новая страница - lastest_items: Страницы за последнее время + latest_items: Страницы за последнее время new: title: Новая страница help: "Заполните форму, приведенную ниже, для создания страницы. Будьте осторожны, по умолчанию, страница не опубликована." @@ -244,7 +244,7 @@ ru: download: скачать элементы new: новый элемент category_noname: "Без имени" - lastest_items: "Элементы за последнее время" + latest_items: "Элементы за последнее время" updated_at: "Обновлено" list: no_items: "На данный момент нет ни одного элемента. Нажмите здесь для создания первого элемента." diff --git a/lib/generators/locomotive/install/templates/locomotive.rb b/lib/generators/locomotive/install/templates/locomotive.rb index def55739..977c4b3a 100644 --- a/lib/generators/locomotive/install/templates/locomotive.rb +++ b/lib/generators/locomotive/install/templates/locomotive.rb @@ -44,7 +44,7 @@ Locomotive.configure do |config| config.delayed_job = false # configure how many items we display in sub menu in the "Contents" section. - # config.lastest_items_nb = 5 + # config.latest_items_nb = 5 # default locale (for now, only en, de, fr, pt-BR and it are supported) config.default_locale = :en diff --git a/lib/locomotive/configuration.rb b/lib/locomotive/configuration.rb index 894aceff..8961e7df 100644 --- a/lib/locomotive/configuration.rb +++ b/lib/locomotive/configuration.rb @@ -16,7 +16,7 @@ module Locomotive :mailer_sender => 'support', #support@example.com' :manage_subdomain => false, :manage_manage_domains => false, - :lastest_items_nb => 5, + :latest_items_nb => 5, :rack_cache => { :verbose => true, :metastore => URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces From 1a5050a0c1213c41ad748bc7bad2a34e12af7887 Mon Sep 17 00:00:00 2001 From: Corey Woodcox Date: Thu, 19 Jan 2012 13:02:56 -0700 Subject: [PATCH 7/8] case sensitive search is a monster. --- config/locales/admin_ui.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/admin_ui.en.yml b/config/locales/admin_ui.en.yml index 2f0d66db..be55c0c3 100644 --- a/config/locales/admin_ui.en.yml +++ b/config/locales/admin_ui.en.yml @@ -245,7 +245,7 @@ en: download: download items new: new item category_noname: "No name" - latest_items: "Lastest items" + latest_items: "Latest items" updated_at: "Updated at" list: no_items: "There are no items for now. Just click here to create the first one." From 7aadd9d129e09bc65113a84a72ff6dd41675180b Mon Sep 17 00:00:00 2001 From: Corey Woodcox Date: Tue, 24 Jan 2012 16:00:56 -0700 Subject: [PATCH 8/8] add a message for deprecated config option --- lib/locomotive/configuration.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/locomotive/configuration.rb b/lib/locomotive/configuration.rb index 8961e7df..ed8a202d 100644 --- a/lib/locomotive/configuration.rb +++ b/lib/locomotive/configuration.rb @@ -16,7 +16,7 @@ module Locomotive :mailer_sender => 'support', #support@example.com' :manage_subdomain => false, :manage_manage_domains => false, - :latest_items_nb => 5, + :latest_items_nb => 5, :rack_cache => { :verbose => true, :metastore => URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces @@ -36,6 +36,16 @@ module Locomotive @@settings end + def lastest_items_nb=(setting) + puts "DEPRACATION WARNING: The Locomotive config setting 'lastest_items_nb' was misspelled and will be removed in a future version. Please use 'latest_items_nb' in your Locomotive initializer." + self.settings.latest_items_nb = setting + end + + def lastest_items_nb + puts "DEPRACATION WARNING: The Locomotive config setting 'lastest_items_nb' was misspelled and will be removed in a future version. Please use 'latest_items_nb' in your Locomotive initializer." + self.settings.latest_items_nb + end + def multi_sites? self.multi_sites != false end