Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Includes:
- Deprecatable
- Defined in:
- lib/acread/active_record_ext.rb
Constant Summary
Constants included from Deprecatable
Instance Method Summary collapse
- #columns ⇒ Object
- #serializable_hash(options = {}) ⇒ Object
-
#super_serializable_hash ⇒ Object
ensure the deprecated attributes will be skip when serialize the record.
Methods included from Deprecatable
Instance Method Details
#columns ⇒ Object
8 9 10 |
# File 'lib/acread/active_record_ext.rb', line 8 def columns self.class.columns.reject { |c| (self.class.deprecated_attributes || []).include? c.name.to_s} end |
#serializable_hash(options = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/acread/active_record_ext.rb', line 15 def serializable_hash( = {}) = {} if .nil? = { :only => self.attributes.keys.map(&:to_sym) - (self.class.deprecated_attributes || []).map(&:to_sym) }.update() super_serializable_hash() end |
#super_serializable_hash ⇒ Object
ensure the deprecated attributes will be skip when serialize the record
14 |
# File 'lib/acread/active_record_ext.rb', line 14 alias_method :super_serializable_hash, :serializable_hash |