From 00b6eed08df47e0afd1e7e0b3ecfcd2ae5a019b0 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Sun, 3 Apr 2011 21:54:49 -0300 Subject: [PATCH] Do not interpolate variable into error message from Article validation --- HACKING.rails235 | 14 ++++++++++++++ app/models/article.rb | 2 +- test/unit/unit_test.rb | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 HACKING.rails235 diff --git a/HACKING.rails235 b/HACKING.rails235 new file mode 100644 index 0000000..f86dc99 --- /dev/null +++ b/HACKING.rails235 @@ -0,0 +1,14 @@ +This is a draft of how to create a environment to Rails 2.3.5 to Noosfero +development. + +Install dependencies: + +gem install rails -v 2.3.5 +gem install ferret +gem install i18n +gem install will_paginate +gem install cucumber + +Creating initial environment: + +rake db:schema:load diff --git a/app/models/article.rb b/app/models/article.rb index 4e89b01..2932593 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -13,7 +13,7 @@ class Article < ActiveRecord::Base validates_presence_of :profile_id, :name validates_presence_of :slug, :path, :if => lambda { |article| !article.name.blank? } - validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('The title (article name) is already being used by another article, please use another title.'), :if => lambda { |article| !article.slug.blank? } + validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('The title (article name) is already being used by another article, please use another title.'), :if => lambda { |article| !article.slug.blank? } belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id' diff --git a/test/unit/unit_test.rb b/test/unit/unit_test.rb index 186d0ea..4fe29a5 100644 --- a/test/unit/unit_test.rb +++ b/test/unit/unit_test.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../test_helper' -class UnitTest < Test::Unit::TestCase +class UnitTest < ActiveSupport::TestCase should 'require singular name' do unit = Unit.new; unit.valid? -- libgit2 0.21.2