Skip to content

Instantly share code, notes, and snippets.

@gamov
Created November 19, 2010 09:07
Show Gist options
  • Save gamov/706273 to your computer and use it in GitHub Desktop.
Save gamov/706273 to your computer and use it in GitHub Desktop.
def save_batches_alloc(hash)
if self.attribute_names.include?('batches_alloc')
write_attribute(:batches_alloc, hash)
else
@batches_alloc= hash
end
end
def load_batches_alloc
if self.attribute_names.include?('batches_alloc')
read_attribute(:batches_alloc)
else
@batches_alloc
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment