def save_record(record, options={}, &block) return nil if record.nil? options = { :add_params => {}, :as => nil, :without_protection => false, :params => params[record.class.name.underscore.to_sym], :user => current_user, }.update options
This pattern works very well for providing defaults and some documentation on what options are available. I still document the options before the function.
This pattern works very well for providing defaults and some documentation on what options are available. I still document the options before the function.