Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/apartment/delayed_job/active_record.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#encode_with_with_database(coder) ⇒ Object
Rails > 3.0 now uses encode_with to determine what to encode with yaml.
-
#to_yaml_properties ⇒ Object
Remain backwards compatible with old yaml serialization.
Class Method Details
.yaml_new(klass, tag, val) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/apartment/delayed_job/active_record.rb', line 7 def self.yaml_new(klass, tag, val) Apartment::Database.process(val['database']) do klass.find(val['attributes']['id']) end rescue ActiveRecord::RecordNotFound => e raise Delayed::DeserializationError, e. end |
Instance Method Details
#encode_with_with_database(coder) ⇒ Object
Rails > 3.0 now uses encode_with to determine what to encode with yaml
17 18 19 20 |
# File 'lib/apartment/delayed_job/active_record.rb', line 17 def encode_with_with_database(coder) coder['database'] = @database if @database.present? encode_with_without_database(coder) end |
#to_yaml_properties ⇒ Object
Remain backwards compatible with old yaml serialization
24 25 26 |
# File 'lib/apartment/delayed_job/active_record.rb', line 24 def to_yaml_properties ['@attributes', '@database'] # add in database attribute for serialization end |