New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best annotation position is different for models and fixtures... #6
Comments
I'll see what I can do. |
Great! |
I've used Dave Thomas' annotate models plugin since at least mid-07 and just found your fork (I have other devs who never bother to run annotations, so the after migrate hook is my reason for changing). IMHO, having the default change for everyone to after the model class based on 1 person's preference is bad form.
new_content = options[:position] == 'after' ? (old_content + "\n" + info_block) : (info_block + old_content)
|
+1 for jlw Please fix the subtle bug that he mentioned. Line 5 and 6 must be end with 'before' instead of :before. Because of this bug, the annotation is inserted after the code without -p option. |
IMHO, annotations at the beginning of the model file seems to be more widely practiced. I agree with @jlw. Can we make 'before' the default option? I've made both of @jlw suggestions above into a pull request here #69 This issue is related to #34. @robertwahler converts |
It's is now possible to have your own config. Please check the documentation. |
The 'best' IMHO position for annotations in models is after all code, since you regularly have to edit it and only refer to annotations irregularly. But for fixtures it's is before all the yaml data, since you can have huge yaml files and scrolling to the bottom is annoying/hard, and use usually only refer to fixtures once or twice in their lifetime (certainly less than models).
Could this be changed to the default behaviour? (I know it makes the current 'before|after' syntax a little hard since it is a mix of both...
Thanks in advance,
The text was updated successfully, but these errors were encountered: