Module: ActiveRecord::Serialization
- Defined in:
- lib/ruboss4ruby/active_foo.rb,
lib/ruboss4ruby/active_record_default_methods.rb
Overview
Flex-friendly serialization patches
Instance Method Summary collapse
- #json_defaults_old_to_json ⇒ Object
-
#to_fxml(options = {}, &block) ⇒ Object
Enforces Flex friendly options on XML and delegates processing to standard
to_xml. -
#to_json(options = {}, &block) ⇒ Object
adds support for default_methods to standard
to_json. -
#to_xml(options = {}, &block) ⇒ Object
adds support for default_methods to standard
to_xml. - #xml_defaults_old_to_xml ⇒ Object
Instance Method Details
#json_defaults_old_to_json ⇒ Object
44 |
# File 'lib/ruboss4ruby/active_record_default_methods.rb', line 44 alias_method :json_defaults_old_to_json, :to_json |
#to_fxml(options = {}, &block) ⇒ Object
Enforces Flex friendly options on XML and delegates processing to standard to_xml
133 134 135 136 137 138 |
# File 'lib/ruboss4ruby/active_foo.rb', line 133 def to_fxml( = {}, &block) .merge!(:dasherize => false) default_except = [:crypted_password, :salt, :remember_token, :remember_token_expires_at] [:except] = ([:except] ? [:except] + default_except : default_except) to_xml(, &block) end |
#to_json(options = {}, &block) ⇒ Object
adds support for default_methods to standard to_json
57 58 59 60 61 62 63 64 |
# File 'lib/ruboss4ruby/active_record_default_methods.rb', line 57 def to_json( = {}, &block) unless [:ignore_defaults] unless [:ignore_default_methods] [:methods] = [[:methods] || []].flatten + (self.class.defaults_hash[:methods] || []) end end json_defaults_old_to_json(, &block) end |
#to_xml(options = {}, &block) ⇒ Object
adds support for default_methods to standard to_xml
47 48 49 50 51 52 53 54 |
# File 'lib/ruboss4ruby/active_record_default_methods.rb', line 47 def to_xml( = {}, &block) unless [:ignore_defaults] unless [:ignore_default_methods] [:methods] = [[:methods] || []].flatten + (self.class.defaults_hash[:methods] || []) end end xml_defaults_old_to_xml(, &block) end |
#xml_defaults_old_to_xml ⇒ Object
42 |
# File 'lib/ruboss4ruby/active_record_default_methods.rb', line 42 alias_method :xml_defaults_old_to_xml, :to_xml |