Permalink
Browse files

Merge pull request #8038 from frodsan/fix_am_serializers_xml_dependency

Fix AM::Serializers::Xml dependency
  • Loading branch information...
2 parents b794440 + 10d9cb2 commit 94f6b3dcfa454043307ba32045223eea0358de67 @jeremy jeremy committed Oct 27, 2012
@@ -1,8 +1,8 @@
require 'active_support/json'
module ActiveModel
- # == Active Model JSON Serializer
module Serializers
+ # == Active Model JSON Serializer
module JSON
extend ActiveSupport::Concern
include ActiveModel::Serialization
@@ -4,12 +4,16 @@
require 'active_support/core_ext/hash/slice'
module ActiveModel
- # == Active Model XML Serializer
module Serializers
+ # == Active Model XML Serializer
module Xml
extend ActiveSupport::Concern
include ActiveModel::Serialization
+ included do
+ extend ActiveModel::Naming
+ end
+
class Serializer #:nodoc:
class Attribute #:nodoc:
attr_reader :name, :value, :type
@@ -4,7 +4,6 @@
require 'active_support/core_ext/object/instance_variables'
class Contact
- extend ActiveModel::Naming
include ActiveModel::Serializers::JSON
include ActiveModel::Validations
@@ -4,7 +4,6 @@
require 'ostruct'
class Contact
- extend ActiveModel::Naming
include ActiveModel::Serializers::Xml
attr_accessor :address, :friends
@@ -25,7 +24,6 @@ class Customer < Struct.new(:name)
end
class Address
- extend ActiveModel::Naming
include ActiveModel::Serializers::Xml
attr_accessor :street, :city, :state, :zip, :apt_number
@@ -1,5 +1,4 @@
class Contact
- extend ActiveModel::Naming
include ActiveModel::Conversion
attr_accessor :id, :name, :age, :created_at, :awesome, :preferences

0 comments on commit 94f6b3d

Please sign in to comment.