|
I've been toying around in Rails 4 using the screencast from Ryan Bates (that stuff is good). Rails 4 is using minitest, which is awesome. But by default when you create a new model tests in Rails are being wrapped in TestCase which I guess is designed to make minitest look and act like test unit. Is there any way to tell Rails "no I want minitest I don't need your ridiculous extra pointless layers of complexity". Or do I just hack at the tests to make them use minitest and minitest::spec myself?
|
# ¿ Jan 8, 2013 15:20 |
|
|
# ¿ May 15, 2024 08:41 |
|
I too, would suggest a date field and a second field that describes the accuracy of the date. Then you could construct a method that puts the two together. released_at: 1-1-2013 period: 'quarter' looks like: Q1 2013 Or something like that. I'd imagine it's best to have a date column any way you decide to do it, just for sort order.
|
# ¿ Jan 13, 2013 03:45 |
|
Nolgthorn posted:I've been toying around in Rails 4 using the screencast from Ryan Bates (that stuff is good). Answering my own question from a few pages ago in case it is helpful to someone else. Default support for Spec was one of the many things taken out of Rails 4 in order to expedite initial release so to get it working use this unofficial gem. https://github.com/metaskills/minitest-spec-rails
|
# ¿ Jan 21, 2013 09:17 |
|
I learned how to use Ruby and Rails simultaneously. I kind of regret that now and wish I'd learned Ruby first. It's a spectacular language but often when I use it I mix up what is just Ruby and what is Rails.
|
# ¿ Jan 28, 2013 15:12 |
|
I've got a Cool question for ActiveRecord peeps. Take a look. Activerecord exposes a very helpful .build method on associations. Ruby code:
Ruby code:
Ruby code:
quote:Undefined method 'build' for Class. So if I can do: Ruby code:
Ruby code:
Ruby code:
Ruby code:
Or even better, how would I do this.
|
# ¿ Mar 14, 2013 16:12 |
|
Yeah. My confusion comes from associations and classes both having find_by but not both having build and therefore it strictly not being available. In my example should I assume the find_by isn't doing what I want in this instance: Ruby code:
Nolgthorn fucked around with this message at 17:00 on Mar 14, 2013 |
# ¿ Mar 14, 2013 16:56 |
|
|
# ¿ May 15, 2024 08:41 |
|
Pardot posted:timestamptz normalizes and only actually stores it as utc. It takes care of everything. If timestamp and timestamptz both store the value in utc then how is Rails wrong? Isn't Rails handling timezones itself, independent from any database?
|
# ¿ Jul 20, 2014 00:14 |