Plugins - xml_protected

StarAdd to favorites

Keeps specified attributes of a model out of toxml. Do so by aliasing toxml, and automatically sending in the correct :excludes to the original to_xml method, e.g. :excludes => [:attr1, :attr2, ...]

h2. Usage

An ActiveRecord Model:

class Model < ActiveRecord::Base
  include XmlProtected # Required because it's a gemmefied plugin
  xml_protected :attr1, :attr2, :attr3
end

You can also access these attributes from the added class method: protectedxmlattributes

h3. In Conjunction with attr_protected

class Model < ActiveRecord::Base
  include XmlProtected # Required because it's a gemmefied plugin
  attr_protected :attr1, :attr2, :attr3
  xml_protected :attr1, :attr2, :attr3
end

ThriveSmart, LLC

http://github.com/thrivesmart/xml_protected

git://github.com/thrivesmart/xml_protected.git

Rails' (MIT)

  • Currently 4.3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?