I am happy to announce that the first release candidate for Rails 3.0.6 has
been pushed to rubygems.org.
## Release Candidate: What does it mean?
The release candidate is very similar to what we will actually release for
version 3.0.6. The reason that we release an RC is so that the community can
have a chance to postpone or veto commits that have happened between the
previous version and the version we're about to release.
We are asking you (yes you!) to *try out* the release candidate. If something
that changed between 3.0.5 and this release candidate breaks your application,
we want to know about it!
## How do I try it out?
Simply update your Gemfile to point at the rails version "3.0.6.rc1", then
`bundle install`.
## Where can I see a list of Changes?
Either look at the CHANGELOG in each particular project on
[github](https://github.com/rails/rails/tree/3-0-6), *or* check out the
handy [compare
view](https://github.com/rails/rails/compare/v3.0.5...v3.0.6.rc1).
Again, per project changelogs:
https://github.com/rails/rails/tree/3-0-6
*or* compare view:
https://github.com/rails/rails/compare/v3.0.5...v3.0.6.rc1
## ZOMG SOMETHING BROKE, WHAT DO I DO?
Email the [rails core mailing list](http://groups.google.com/group/rubyonrails-core)
at let us know about the problem! We will discuss the problem and how to handle
it before the final version is pushed.
## WHEN WILL THE FINAL VERSION BE RELEASED?!?!?!
Unless there are problems found in the RC, we will release the final version
no less than 72 hours from *now*, but not exactly 72 hours from now (as I will
be on vacation :-P).
If there are problems found in the RC, we will release another RC and give the
community another chance to test before releasing.
## IN CLOSING
Remember, this is *your* chance to veto / postpone our release. Despite the
lols I have in this email, please take advantage of this opportunity! We do not
want to break people's applications. The best we can do is ask for help!
Thanks for listening everyone!
<3 <3 <3 <3 <3
--
Aaron Patterson
http://tenderlovemaking.com/
ActiveModel::Name does not have :i18n_key method anymore.
Robert Pankowecki
ruby-1.9.2-p136 :004 > Time.now
=> 2011-03-30 01:15:20 +0200
ruby-1.9.2-p136 :005 > Date.today
=> Wed, 30 Mar 2011
ruby-1.9.2-p136 :006 > Date.yesterday
=> Mon, 28 Mar 2011
ruby-1.9.2-p136 :007 > Time.zone
=> (GMT+00:00) UTC
ruby-1.9.2-p136 :008 > Date.tomorrow
=> Wed, 30 Mar 2011
As you can see the simple expectation that yesterday = today -1 and
tomorrow = today + 1 is apparently not true in some cases. This
problem probably happens around midnight in some zones...
Do you want me to create tickets for them ?
Robert Pankowecki
I also already started following a convention of namespacing classes
only in modules (never in another classes) because of problems
mentioned in
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6448-i18n-key-collision-with-namespaced-models#ticket-6448-11
I would have:
class Articles
module Articles
class Articles::Articles
This a big break in API and it happens second time during last 5
releases. Could we clarify this thing once for all the time?
Robert Pankowecki
class Articles
module Articles
class Articles::Category
Then Jos� Valim thought it was a bug and asked me to create another issue:
https://rails.lighthouseapp.com/projects/8994/tickets/5572
Then, this issue was created:
https://rails.lighthouseapp.com/projects/8994/tickets/6448
Then Valim reverted 5572.
Now I know that my i18n locale files should be written like this:
pt-BR:
activerecord:
errors:
models:
my_module/order:
attributes:
amount:
not_a_number: deve ser um n�mero
I think there will be no more confusing regarding this behavior now we
all know what to expect. Maybe there is some documentation missing,
regarding modules and i18n keys.
Best regards,
Rodrigo.
Then José Valim thought it was a bug and asked me to create another issue:
https://rails.lighthouseapp.com/projects/8994/tickets/5572
Then, this issue was created:
https://rails.lighthouseapp.com/projects/8994/tickets/6448
Then Valim reverted 5572.
Now I know that my i18n locale files should be written like this:
pt-BR:
activerecord:
errors:
models:
my_module/order:
attributes:
amount:
not_a_number: deve ser um número
I think there will be no more confusing regarding this behavior now we all know what to expect. Maybe there is some documentation missing, regarding modules and i18n keys.
> I agree we should support both for now, and deprecate one. I'll come
> up with a test and fix, and we'll release a new RC.
Or we could add a setting which version you prefer.
> Thanks for reporting this!
Thanks for RC release and the ability to test and veto :-)
Robert Pankowecki
Yes 3.0.4, 3.0.5, 3.0.6.rc1, maybe even earlier versions.
Robert Pankowecki
We'll discuss this on LH, but this ticket won't block the release.
Thanks for filing this!
Just so we're on the same page, we would expect this test to pass:
diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb
index 1db63e1..0584606 100644
--- a/activemodel/test/cases/translation_test.rb
+++ b/activemodel/test/cases/translation_test.rb
@@ -39,6 +39,15 @@ class ActiveModelI18nTests < ActiveModel::TestCase
assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute')
end
+ def test_translated_model_attributes_with_attribute_matching_namespaced_model_name_and_dot
+ assert_deprecated do
+ I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:gender => 'person gender'}, :"person.gender" => {:attr
+ end
+
+ assert_equal 'person gender', Person.human_attribute_name('gender')
+ assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute')
+ end
+
def test_translated_model_names
I18n.backend.store_translations 'en', :activemodel => {:models => {:person => 'person model'} }
assert_equal 'person model', Person.model_name.human
If that's true, I'll try to get another RC out tonight. If not, we may have to wait for a few days as I'll be on vacation. :-(
Fixed that for you. :)
Sorry, I meant this:
diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb
index 1db63e1..4deffc3 100644
--- a/activemodel/test/cases/translation_test.rb
+++ b/activemodel/test/cases/translation_test.rb
@@ -39,6 +39,15 @@ class ActiveModelI18nTests < ActiveModel::TestCase
assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute')
end
+ def test_translated_model_attributes_with_attribute_matching_namespaced_model_name_and_dot
+ assert_deprecated do
+ I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:gender => 'person gender'}, :"person.gender" => {:attribute => 'person gender attribute'}}}
+ end
+
+ assert_equal 'person gender', Person.human_attribute_name('gender')
+ assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute')
+ end
+
def test_translated_model_names
I18n.backend.store_translations 'en', :activemodel => {:models => {:person => 'person model'} }
assert_equal 'person model', Person.model_name.human
--
Aaron Patterson
http://tenderlovemaking.com/
+ def test_translated_model_attributes_with_attribute_matching_namespaced_model_name_and_dot+ I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:gender => 'person gender'}, :"person.gender" => {:attribute => 'person gender attribute'}}}
+ assert_deprecated do
+ end
+
+ assert_equal 'person gender', Person.human_attribute_name('gender')
+ assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute')
+ end
+