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.
About the Author