I get a complaint about purchase, price_in_cents and response not mass assigned, i ended up disabling it after many attempts but obviously running Brakeman brings back the issues. How can i add these to my attr_accessible?
Are you saying you set :attr_accessible nil and it won't let you assign any attributes? If that's the case, just manually set them when necessary. New/create/build take a block form so you can do this somewhat nicely:
Something.create(params[:something]) do |thing|
thing.attr = params[:something][:attr]
end
while I realize that seems silly, it's better than the alternative :)
Are you saying you set :attr_accessible nil and it won't let you assign any attributes? If that's the case, just manually set them when necessary. New/create/build take a block form so you can do this somewhat nicely:
Something.create(params[:something]) do |thing|
thing.attr = params[:something][:attr]
end
while I realize that seems silly, it's better than the alternative :)
Unfortunately, "redirect_to redirect_url, only_path: true" won't work. It works only, when you pass first argument as a Hash and it should contain :only_path options. When you have redirect_url as a string you can use URI.parse(redirect_url).path or URI.parse(redirect_url).request_uri, hovewer request_uri is available only on URI::HTTP objects, so additional checks might be needed.
[Notice] Detected Rails 3 application
Loading scanner...
[Notice] Using Ruby 1.9.2. Please make sure this matches the one used to run your Rails application.
Processing application in /home/**/projects/**
Processing configuration...
[Notice] Escaping HTML by default
Processing gems...
Processing initializers...
Processing libs...
Processing routes...
Processing templates...
Processing data flow in templates...
Processing models...
Processing controllers...
Processing data flow in controllers...
Killed7 controllers processed
Reaches 62/127 for data flow in controllers then hangs and dies.
Nice, trying it out right away. Since im the first one here, i might be lucky and get a response. :)
I have disabled mass assignment on my shopping cart because i am using this
I get a complaint about purchase, price_in_cents and response not mass assigned, i ended up disabling it after many attempts but obviously running Brakeman brings back the issues. How can i add these to my
attr_accessible
?Are you saying you set :attr_accessible nil and it won't let you assign any attributes? If that's the case, just manually set them when necessary. New/create/build take a block form so you can do this somewhat nicely:
while I realize that seems silly, it's better than the alternative :)
Are you saying you set :attr_accessible nil and it won't let you assign any attributes? If that's the case, just manually set them when necessary. New/create/build take a block form so you can do this somewhat nicely:
while I realize that seems silly, it's better than the alternative :)
If you think brakeman gem is useful, you must try my online service based on brakeman, rails-brakeman
Unfortunately, "redirect_to redirect_url, only_path: true" won't work. It works only, when you pass first argument as a Hash and it should contain :only_path options. When you have redirect_url as a string you can use URI.parse(redirect_url).path or URI.parse(redirect_url).request_uri, hovewer request_uri is available only on URI::HTTP objects, so additional checks might be needed.
after gem install brakeman and adding it to my gemfile, I keep getting
and rbenv rehash gives me
I'm able to rehash now
I'm not sure why but it started working after I ran
Thanks, rehashing is what I needed, too
bundle exec brakeman
Awesome - thanks! This makes me feel a lot better about my app :D
Would love to see a similar episode on performance (slow queries etc) although knowing Ryan he has probably already done one!
The
bullet
-gem notifies you of eager loading SQL queries :)Seems it is crashing out on our project.
[Notice] Detected Rails 3 application
Loading scanner...
[Notice] Using Ruby 1.9.2. Please make sure this matches the one used to run your Rails application.
Processing application in /home/**/projects/**
Processing configuration...
[Notice] Escaping HTML by default
Processing gems...
Processing initializers...
Processing libs...
Processing routes...
Processing templates...
Processing data flow in templates...
Processing models...
Processing controllers...
Processing data flow in controllers...
Killed7 controllers processed
Reaches 62/127 for data flow in controllers then hangs and dies.
Hi Jay,
Sorry about that. Please follow these suggestions to figure out the problem.