app/models/place.rb
# Create a CheckList associated with this place
Create a CheckList associated with this place
Create a CheckList associated with this place
def check_default_check_list
    if too_big_for_check_list? && !prefers_check_lists && check_list
      delay(:priority => USER_INTEGRITY_PRIORITY).remove_default_check_list
    end
    if place_type == PLACE_TYPE_CODES['Continent'] || too_big_for_check_list?
      self.prefers_check_lists = false
    end
    if prefers_check_lists && check_list.blank?
      self.create_check_list(:place => self)
      save(:validate => false)
      unless check_list.valid?
        Rails.logger.info "[INFO] Failed to create a default check list on " + 
          "creation of #{self}: " + 
          check_list.errors.full_messages.join(', ')
      end
    end
    true
  end
def check_default_check_list if too_big_for_check_list? && ! prefers_check_lists && check_list delay ( :priority => USER_INTEGRITY_PRIORITY ) . remove_default_check_list end if place_type == PLACE_TYPE_CODES [ 'Continent' ] || too_big_for_check_list? self . prefers_check_lists = false end if prefers_check_lists && check_list . blank? self . create_check_list ( :place => self ) save ( :validate => false ) unless check_list . valid? Rails . logger . info "[INFO] Failed to create a default check list on " + "creation of #{self}: " + check_list . errors . full_messages . join ( ', ' ) end end true end
Create a CheckList associated with this place
Create a CheckList associated with this place