Live data from Hacker News

Rails 4.1.0 beta1 released

weblog.rubyonrails.org

11–20 of 61 posts

Re: Rails 4.1.0 beta1 released

#11
post #5

wow, the action mailer preview thing is one of those things you're amazed didn't exist until now. i remember rigging this up manually a few times after getting sick of sending a million test emails to myself. great work rails team!

The letter_opener gem is pretty handy to avoid that: https://github.com/ryanb/letter_opener

Or, you could easily just create controller actions which render your emails as well:

@body = mail.body.parts[1].html_part.body.raw_source

render '/mailer_notification/preview.html', :layout => false

And in preview.html.erb:

Re: Rails 4.1.0 beta1 released

#12
Love Spring. Will help every day development immensely.

Thank you for the ActionMailer previews. Working on an app with a bunch of mailers - things get wily fast, and a bunch of static files sit around to be tested for display.

I think the secrets.yml idea, while in development, is awesome and helpful for organization. However, I'd be a little concerned that a single file has everything secret-y in it. Maybe that's paranoia though. It'd be nice if this wasn't just a config thing that I could hand roll myself, and instead offered some sort of obscuration/security measure in and of itself.

Re: Rails 4.1.0 beta1 released

#13

Wow. These are STELLAR improvements! Check out the release notes here: https://github.com/rails/rails/blob/master/guides/source/4_1... So excited about all of it. Native enum is a blessing. Took me a while to figure it out but here is the required line for your Gemfile: gem 'rails', '4.0.1.beta1' # This works too, but isn't required (thanks to cantoniodasilva's comment below) # gem 'rails', github: 'rails/rails', tag…

You should be able to point the gem to '4.1.0.beta1' too, instead of relying on the git tag.

Re: Rails 4.1.0 beta1 released

#14

The only issues I have with this release is that they could of waited until after the holidays. I have a feeling we'll see a security patch right before xmas. The second issue I have is `secrets` should be entirely removed from the framework. These settings should NOT be stored at the file level, it should be handled by environment flags. I feel this is a fundamentally broken feature. Spring is neat, was it just a po…

> Spring is neat, was it just a port of Zeus into Rails?

Conceptually, they're the same thing, but since Zeus is written in Go, it's totally different code.

> These settings should NOT be stored at the file level, it should be handled by environment flags. I feel this is a fundamentally broken feature.

I personally use environment variables to handle this case, but basically, every single approach has pros and cons, not to mention that there's legacy codebases... small steps.

Re: Rails 4.1.0 beta1 released

#15

The only issues I have with this release is that they could of waited until after the holidays. I have a feeling we'll see a security patch right before xmas. The second issue I have is `secrets` should be entirely removed from the framework. These settings should NOT be stored at the file level, it should be handled by environment flags. I feel this is a fundamentally broken feature. Spring is neat, was it just a po…

No...Zeus is its own thing, AFAIK, though I guess it's described (by the Zeus maintainer) as "like Zeus but in pure Ruby, totally automatic, alpha and limited compatibility"

https://github.com/burke/zeus#related-gems

I started using Zeus a couple of weeks ago and then switched over to Spring last week...I never figured out how to get the custom Zeus files to let me run regular rails/rake commands with certain flags and parameters, but Spring pretty much worked right out of the box. It works so well that I've been wary that it might cause issues in edge cases of test configuration, but haven't run into any yet...and now that it's a part of Rails, guess I'll be even less wary.

It's definitely changed how I do TDD for Rails, in that I will actually do TDD for Rails, because the tests run so quickly. Yes, being hindered by Rails bootup just to run tests might be indicative of unneeded coupling, but sometimes a project doesn't require great abstraction, but still needs decent integration coverage. Spring is pretty handy for that.

Re: Rails 4.1.0 beta1 released

#16

Wow. These are STELLAR improvements! Check out the release notes here: https://github.com/rails/rails/blob/master/guides/source/4_1... So excited about all of it. Native enum is a blessing. Took me a while to figure it out but here is the required line for your Gemfile: gem 'rails', '4.0.1.beta1' # This works too, but isn't required (thanks to cantoniodasilva's comment below) # gem 'rails', github: 'rails/rails', tag…

You should be able to point the gem to '4.1.0.beta1' too, instead of relying on the git tag.

Good to know, thanks.

Note to the Rails team: might want to add this to your blog post and/or release notes?

Perhaps I am the only person in the world who did not realize this would work. #noob

Re: Rails 4.1.0 beta1 released

#18

The only issues I have with this release is that they could of waited until after the holidays. I have a feeling we'll see a security patch right before xmas. The second issue I have is `secrets` should be entirely removed from the framework. These settings should NOT be stored at the file level, it should be handled by environment flags. I feel this is a fundamentally broken feature. Spring is neat, was it just a po…

If a project owner updates prod to a new beta of a point release right during the holiday season, that's entirely their fault, not the rails team who delivered something fun for people to mess around with.

Re: Rails 4.1.0 beta1 released

#19

Wow. These are STELLAR improvements! Check out the release notes here: https://github.com/rails/rails/blob/master/guides/source/4_1... So excited about all of it. Native enum is a blessing. Took me a while to figure it out but here is the required line for your Gemfile: gem 'rails', '4.0.1.beta1' # This works too, but isn't required (thanks to cantoniodasilva's comment below) # gem 'rails', github: 'rails/rails', tag…

We pushed a build to RubyGems.org[1], so you should be able drop the github option now:

    gem 'rails', '4.1.0.beta1'
We upgraded a few apps in our local Ruby meetup group lately[2], and it's worth mentioning that you might need to upgrade the following gems too:

    gem 'rspec', '~> 3.0.0.beta1'
    gem 'rspec-rails', '~> 3.0.0.beta1'
    gem 'capybara', '~> 2.2.0'
    gem 'jquery-rails', github: 'takkanm/jquery-rails', branch:' fix_action_view_require'
    (I'm not 100% sure about the last one, might have been fixed since I last checked)
I'll try to write this up in another blog post tomorrow.

[1]: http://rubygems.org/gems/rails/versions/4.1.0.beta1

[2]: http://www.meetup.com/vancouver-ruby/messages/61805312/

Edit: minor formatting fixes

Re: Rails 4.1.0 beta1 released

#20

The only issues I have with this release is that they could of waited until after the holidays. I have a feeling we'll see a security patch right before xmas. The second issue I have is `secrets` should be entirely removed from the framework. These settings should NOT be stored at the file level, it should be handled by environment flags. I feel this is a fundamentally broken feature. Spring is neat, was it just a po…

> These settings should NOT be stored at the file level, it > should be handled by environment flags. I feel this is a > fundamentally broken feature.

According to https://github.com/rails/rails/blob/master/railties/lib/rail..., this YAML file is handled like every other YAML by Rails...it's parsed through ERB first.

That means, you can do something like

    development:
      secret_key_base: 
And reference it with that `Rails.configuration` business.

With this, you basically get a nice little API for recalling env variables. Pretty neat!

Post reply on HN