Rails Exporter Plugin
Model files
http://rails.kirschekreativ.de/model-files.html

Copyright © 2013 Joerg Kirschstein

 

Model files

COMMENTS
Table comments are converted into ruby comments.

ATTR_ACCESSIBLE
If the field is part of the seeds process, the mass assign access is granted with "attr_accessible".

RELATIONS
According to relations, "has_one" | "has_many" | "belongs_to" | "has_and_belongs_to_many" is set.
":through" and ":foreign_key" and ":as" for polymorphic relations are possible attributes.

VALIDATION
NOTNULL is set as ":presence => true", UNIQUE as ":uniqueness => true" or ":uniqueness => { :scope => ...".
The limit is set as ":length => { :maximum =>".