Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
[SF][Standup] 09/19/12: ActiveAdmin vs. RailsAdmin… Arrrggg!

Interestings

  • ActiveAdmin after_save

If you are using ActiveAdmin, beware that the after_save callback gets fired both when the model gets saved, and when there are validation errors on the model.

It really behaves like a callback after the model save method gets called, regardless of its return value.

  • Testing RailsAdmin custom actions

Let’s say you’re writing a RailsAdmin custom action, and you want to test it with a request spec.

If the test passes when guard is on, but fails when guard is off, then you’ve forgotten that the RailsAdmin initializer does not run when loading a rake task. It does run as part of bundle exec guard start.

This is a performance ‘optimization’ that RailsAdmin adds.

To turn it back on, so you can test custom actions:

task :default => [:load_rails_admin_initializer]
task :load_rails_admin_initializer do
ENV[‘SKIP_RAILS_ADMIN_INITIALIZER’] = ‘false’
end

  • International Talk Like a Pirate Day!

Arrrgggggg me mateys! To your pairs you scabrous dogs!

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *