Skip to content

@willrjmarshall /gist:1727570
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class ParentClass < ActiveRecord::Base
has_many :child_classes
end
class ChildClass < ActiveRecord::Base
belongs_to :parent_class
def self.class_method(csv_row)
# Pivots the CSV row into a set of ChildClass instances with a reference to parent_class_instance
# Like
end
end
# I want to do this:
parent_class_instance.child_classes.class_method
#like running
parent_class_instance.child_classes.create(hash)
# but creating a set of instances, not a single instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.