This project is archived and is in readonly mode.
Rails::Generators::GeneratedAttribute: tests, cleanups and a bugfix
Reported by Jeff Kreeftmeijer | May 17th, 2010 @ 09:44 PM | in 3.0.2
After starting writing some tests for
Rails::Generators::GeneratedAttribute.field_type
in
the Bugmash ( #2377 ), I decided to go ahead and write more
tests and do some cleaning up.
Also, I've fixed a little bug in
Rails::Generators::GeneratedAttribute.default
(You
can't do .to_s(:db)
on a Date
object).
The patch is in the comments. :)
Comments and changes to this ticket
-
Jeff Kreeftmeijer May 17th, 2010 @ 09:45 PM
- Tag changed from bug, cleanup, generators, patch, tests to 3.x, bug, cleanup, generators, patch, tests
-
Rohit Arondekar May 20th, 2010 @ 10:32 AM
- State changed from new to resolved
- Assigned user set to Rizwan Reza
+1 Nice DRY'ing up, looks cleaner and all tests pass(on 1.9.2-head).
However I got a warning from Git:
rohit@rohit-desktop:~/remote-repos/rails_patches/working3$ git am < ../others_patches/generated_attribute_tests.diff
Applying: Rails::Generators::GeneratedAttribute: tests, cleanups and a bugfix [#4631 state:resolved]
/home/rohit/remote-repos/rails_patches/working3/.git/rebase-apply/patch:176: trailing whitespace./home/rohit/remote-repos/rails_patches/working3/.git/rebase-apply/patch:183: trailing whitespace.
/home/rohit/remote-repos/rails_patches/working3/.git/rebase-apply/patch:192: trailing whitespace.
warning: 3 lines add whitespace errors.
-
Ryan Bigg May 20th, 2010 @ 11:14 AM
- State changed from resolved to open
Please be careful with putting bracketted stuff like [#ticket_no resolved] as it will mark that ticket as resolved.
-
Rohit Arondekar May 20th, 2010 @ 11:26 AM
Sorry about that, and thanks Ryan for changing state to open. Will take care not to repeat this again.
-
Jeff Kreeftmeijer May 20th, 2010 @ 03:35 PM
Checked the trailing whitespace problem out, seemed that there were some trailing spaces in
railties/test/generators/generated_attribute_test.rb
. Here's a new patch. :) -
Rohit Arondekar May 20th, 2010 @ 04:15 PM
One test fails on 1.9.2-head, see => http://pastie.org/969479
It appears that in 1.9.2 Proc doesn't have marshal_dump defined. But playing in irb I noticed both 1.8.7 and 1.9.2-head, Proc doesn't have marshal_dump defined, so where is it coming from?Someone might want to look at marshal.rb in activesupport, it has some 1.9.2 stuff in it, I don't know if it's relevant though.
-
Rohit Arondekar May 20th, 2010 @ 04:44 PM
I made a mistake in my original comment, I had tested on 1.8.7 and not 1.9.2-head.
-
Rizwan Reza May 20th, 2010 @ 05:09 PM
- no changes were found...
-
Jeff Kreeftmeijer May 22nd, 2010 @ 09:24 AM
I can't seem to reproduce Rohit's test fail on master with and without the patch on Ruby 1.8.7-p249 and 1.9.1-p376.
Can anybody else reproduce this? Also, isn't it really unlikely that my patch would cause this?
-
Rohit Arondekar May 22nd, 2010 @ 10:21 AM
I had tested on 1.9.2-head. I tried again both before and after applying the patch and all tests pass.
P.S I have no idea why it failed the last time, maybe my environment is borked. :(
-
Anil Wadghule May 24th, 2010 @ 08:44 PM
+1 tests pass (1.8.7)
One thing, is it right to replace then Date.today.to_s(:db) with then Date.today.to_s?
If I recall correctly, Date object also supported .to_s(:db).
-
Jeff Kreeftmeijer May 24th, 2010 @ 09:20 PM
Anil was right, I've put
.to_s(:db)
back, and includedactive_support/time
inRails::Generators::GeneratedAttribute
. Here's a new patch. :) -
Rohit Arondekar May 27th, 2010 @ 12:10 PM
+1 Tests pass on
ruby 1.9.2dev (2010-05-08 trunk 27665)
ruby 1.8.7 (2009-06-12 patchlevel 174)Like the DRY'ing up and the tests look cleaner.
-
Shih-gian Lee May 27th, 2010 @ 04:11 PM
+1 for me too on 1.8.7. Agree with Rohit. Like the code refactoring to make it more DRY.
-
Rizwan Reza June 6th, 2010 @ 10:38 AM
- Milestone cleared.
- Tag changed from 3.x, bug, cleanup, generators, patch, tests to 3.x, bug, bugmash-review, cleanup, generators, patch, tests
- State changed from open to verified
-
Santiago Pastorino June 10th, 2010 @ 02:14 AM
- Assigned user changed from Rizwan Reza to José Valim
-
Repository June 10th, 2010 @ 07:08 PM
- State changed from verified to resolved
(from [d93b45e8d32e3c4917c6b16bcea3a694800d2c49]) Rails::Generators::GeneratedAttribute: tests, cleanups and a bugfix [#4631 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/d93b45e8d32e3c4917c6b16bcea3a6... -
Rizwan Reza June 13th, 2010 @ 08:15 PM
- Tag changed from 3.x, bug, bugmash-review, cleanup, generators, patch, tests to 3.x, bug, cleanup, generators, patch, tests
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Medium
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 4631 Rails::Generators::GeneratedAttribute: tests, cleanups and a bugfix However I got a warning from Git: rohit@rohit-desktop:~/r...
- 4631 Rails::Generators::GeneratedAttribute: tests, cleanups and a bugfix (from [d93b45e8d32e3c4917c6b16bcea3a694800d2c49]) Rails::...