Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

7/13/2012 – Happy Friday

Glenn Jahnke
Friday, July 13, 2012

Helps

  • Heroku Maintenance Mode Fail

Does anyone know why maintenance mode doesn’t seem to work? Is there any way to check from the command line that we are in maintenance mode?

– (Ken) This is how I test it on heroku_san: https://github.com/fastestforward/heroku_san/blob/master/features/step_definitions/remote_steps.rb#L130

  • Sending Faxes from Rails

Anyone had to send a fax from Ruby/Rails? Any good SaaS you used to do it?

  • carrierwave custom processing is called twice

Dumb workaround:

def intelligent_crop
crop_to = model.crop_to
# crop_to = [left_x, top_y, width, height]

manipulate! do |img|
  # guard against the second time intelligent_crop is called
  if (img.columns != crop_to[2] || img.rows != crop_to[3])
    img.crop!(*model.crop_to)
  end

  img
end

end

version :cropped_preview do
process :intelligent_crop
end

No one seems to have heard of this particular bug, unfortunately.

  • acts_as_soft_delete

What is the best soft-delete gem to help you not actually delete records?

acts_as_soft_delete_by_field was recommended, however rolling your own is probably also a very reasonable idea: this is pretty closely tied to your business logic.

Interestings

  • validate_presence_of does not work with booleans

…because it fails if the boolean is set to false. Use

validates_inclusion_of :boolean_field, in: [true, false], allow_nil: false

instead.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Add New Comment Cancel reply

Your email address will not be published.

Glenn Jahnke

Glenn Jahnke
San Francisco

Recent Posts

  • iOS Acceptance and Ruby Keywords
  • Standup 1/9/2012
  • Standup 1/5/2012 – The Death of SOAP
Subscribe to Glenn's Feed

Author Topics

rails (3)
ios (1)
ruby (8)
testing (1)
javascript (4)
jenkins (2)
tdd (2)
scala (2)
rubymine (2)
mysql (1)
agile (5)
iteration planning meetings (1)
performance (1)
jasmin (2)
rspec (1)
data processing (1)
cruisecontrol (1)
rvm (1)
android (1)
mobile (1)
mongodb (1)
concurrent programming (1)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >