applicake/doorkeeper — pull request #87 by Jarred-Sumner (2012-05-17 06:31:13+00:00)
Title: Fixed Mass Assignment in the issue_token methods

On a Rails 3.2 app, I kept getting mass assignment errors that looked like this:

```
ActiveModel::MassAssignmentSecurity::Error in Doorkeeper::AuthorizationsController#create

Can't mass-assign protected attributes: application_id, resource_owner_id, expires_in, redirect_uri, scopes

{"utf8"=>"✓",
"authenticity_token"=>"tLPCDv9Av+IQTRsnb90LYC76nBj0Fc3aD8PzUEyYC2w=",
"authorization"=>{"client_id"=>"54ebf3506765d7e6974842468dcbf50aa904d37f65008964bf596e9d4bf28058",
"redirect_uri"=>"https://lockitron.com",
"state"=>"",
"response_type"=>"code",
"scope"=>""},
"commit"=>"Authorize"}
```

All I did was change ```Doorkeeper::OAuth::Authorization::Token``` and ```Doorkeeper::OAuth::Authorization::Token``` to instantiate ```AccessToken```/```AccessGrant``` and fill the neccessary accessors, and then save it. Then, it returns the instance variable for that ```AccessToken``` or ```AccessGrant```

I'm not really sure what to test here though.

Also note that this is my first pull request, so I don't really know what I'm doing.