Skip to content

Instantly share code, notes, and snippets.

@sineed
sineed / ams.rb
Last active Jun 10, 2020
Upgrade AMS from 0.9.0 to 0.10.0
View ams.rb
module AMS
module V09
class Serializer < ActiveModel::Serializer
def serializable_hash(adapter_options = nil,
options = {},
adapter_instance = self.class.serialization_adapter_instance)
object.nil? ? nil : super
end
end
@sineed
sineed / nested_attributes_for_strategy.rb
Created Feb 28, 2014
FactoryGirl.nested_attributes_for(your_ar_factory_with_nested_attributes)
View nested_attributes_for_strategy.rb
class NestedAttributesForStrategy
def association(runner)
runner.run
end
def result(evaluation)
evaluation.object.tap do |instance|
evaluation.notify(:after_build, instance)
return attributes(instance)
end
You can’t perform that action at this time.