Skip to content

Instantly share code, notes, and snippets.

@adelcambre
Created September 26, 2008 20:21
Show Gist options
  • Select an option

  • Save adelcambre/13194 to your computer and use it in GitHub Desktop.

Select an option

Save adelcambre/13194 to your computer and use it in GitHub Desktop.
def published=(binary_string)
# We need this because the values get populated from the params
attribute_set(:published, binary_string == "1")
end
article["published"] = true if article["published"] == "1"
result = @article.update_attributes(article)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment