support for rails 4.0

i tested it with rails 3.2.12 and rails 4.0.0beta1.
`rake spec` was all passed.