Archive by Author

Global Email Settings in Rails

I was running the functional test and didn’t realize it was sending actual emails from my data fixtures. However, I did learn how to globally set the email settings so not to send the emails out during tests. If you want to use this, create a file called global_email_settings.rb (or whatever you want to name [...]

Comments ( 0 )

Global Email Settings in Rails

I was running the functional test and didn’t realize it was sending actual emails from my data fixtures. However, I did learn how to globally set the email settings so not to send the emails out during tests. If you want to use this, create a file called global_email_settings.rb (or whatever you want to name [...]

Comments ( 1 )

to_proc or not to proc

Instead of writing this Profile.find(:all).collect{ |x| x.email } I could write this using Rails’ Symbol#to_proc Profile.find(:all).collect(&:email) Nice.

Comments ( 0 )

Use filter_parameter_logging for your password

This morning while I was looking at some codes, I’ve found something interesting. When I login, I looked at the logs and I could see clearly the password that I’d just entered. Example Parameters: {“commit”=>”Log in”, “action”=>”create”, “controller”=>”sessions”, “password”=>”password123″, “login”=>”foobar”} I know, this looks like a trivial matter but imagine anyone having access to our [...]

Comments ( 1 )

to_proc or not to_proc

Instead of writing this [sourcecode language='ruby'] Profile.find(:all).collect{ |x| x.email } [/sourcecode] I could write this using Rails’ Symbol#to_proc [sourcecode language='ruby'] Profile.find(:all).collect(&:email) [/sourcecode] Nice.

Comments ( 1 )

User filter_parameter_logging for password

This morning while I was looking at some codes, I’ve found something interesting. When I login, I looked at the logs and I could see clearly the password that I’d just entered. Example [sourcecode language="ruby"] Parameters:{“commit”=>”Log in”, “action”=>”create”,”controller”=>”sessions”, “password”=>”password123″,”login”=>”foobar”} [/sourcecode] I know, this looks like a trivial matter but imagine anyone having access to our [...]

Comments ( 0 )

Hello World

[sourcecode language='ruby']puts ‘Hello World’[/sourcecode]

Comments ( 0 )