app/models/service_learning/service_learning_course.rb
def toggle_open(value = nil)
    update_attribute :finalized, true if !finalized && !open?
    if value === nil
      new_value = self.open? ? nil : '1900-01-01 00:00:00'
    else
      new_value = (value == true || value == "true") ? '1900-01-01 00:00:00' : nil
    end
    update_attribute :registration_open_time, new_value
    open?
  end
# Toggles the +open+ attribute for this course by switching registration_open_time between nil and a time in the future.
# You can also pass a new value (true or false) as a parameter to force it to that value.
Toggles the +open+ attribute for this course by switching registration_open_time between nil and a time in the future.
You can also pass a new value (true or false) as a parameter to force it to that value.
Toggles the + open + attribute for this course by switching registration_open_time between nil and a time in the future . You can also pass a new value ( true or false ) as a parameter to force it to that value .
def toggle_open(value = nil)
    update_attribute :finalized, true if !finalized && !open?
    if value === nil
      new_value = self.open? ? nil : '1900-01-01 00:00:00'
    else
      new_value = (value == true || value == "true") ? '1900-01-01 00:00:00' : nil
    end
    update_attribute :registration_open_time, new_value
    open?
  end
def toggle_open ( value = nil ) update_attribute :finalized , true if ! finalized && ! open? if value === nil new_value = self . open? ? nil : '1900-01-01 00:00:00' else new_value = ( value == true || value == "true" ) ? '1900-01-01 00:00:00' : nil end update_attribute :registration_open_time , new_value open? end
Toggles the +open+ attribute for this course by switching registration_open_time between nil and a time in the future.
Toggles the + open + attribute for this course by switching registration_open_time between nil and a time in the future .
value