Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created November 12, 2013 04:29
Show Gist options
  • Save jackcallister/7425495 to your computer and use it in GitHub Desktop.
Save jackcallister/7425495 to your computer and use it in GitHub Desktop.
Pending changes
def pending_changes?
return false if !status.published?
original_attributes = Product.last.attributes.symbolize_keys.except(*publish_excluded_attributes)
published_attributes = Product.last.published_record.attributes.symbolize_keys.except(*publish_excluded_attributes)
original_attributes == published_attributes ? false : update_attribute(:published_status, 'changed')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment