FactoryGirl rename auto generated files - factory-bot

When using FactoryGirl and generating a new model company it generates a factory as well in: spec/factories/companies.rb.
For personal preference and the way I use ctrl+p in sublime text I want to rename the auto generated files to spec/factories/companies_factory.rb.
I've viewed the generators documentation but I don't see any way to overide another gems implementation.
A point in the right direction will be super :)

Adding this to your application.rb should do what you want:
config.generators do |g|
g.factory_girl suffix: 'factory'
end

Related

Have VSCode ignore specific reference links in markdown validation

In Visual Studio Code with Markdown validation enabled (markdown.validate.enabled: true), I can ignore links to specific files that may not exist in the current context via the markdown.validate.ignoredLinks setting. However, that setting does not seem to apply to reference links (e.g. [link]: some-reference), nor can I find a corresponding setting specific to reference links.
Why do I want this? My specific use-case involves an extension the "standard" (CommonMark) markdown format to auto-generate a table-of-contents using the following syntax (and no, I don't expect VSCode to generate a preview of that TOC):
[[_TOC_]]
<!-- or -->
[TOC]
VScode happily generates a warning for such links, namely:
No link definition found: 'TOC' (link.no-such-reference)
Somewhat obviously, I can make the warning disappear I define a (bogus) TOC reference, such as:
[toc]: bogus
I can also disable validation of all reference links ("markdown.validate.referenceLinks.enabled": false), but I don't want to do that. I want to ignore the error for a specific reference, much like one can ignore a GLOB pattern for file links (markdown.validate.ignoredLinks).
Does anyone know of a such a setting before I submit a bug/missing-feature report?

Columns Layout export

Sparx Enterprise Architect offers the possibility to define custom layouts for list views in the package browser and to save these definitions. When exporting a Project file (*.eap) via xmi, these definitions are not included in the export-file and thus lost. I wonder whether there exists a way to transfer columns layout definitions between two EA-Projects.
Many thanks in advance for every hint!
As Geert suggested the layout is stored in the registry.
[HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS]
holds a key PKG_BRWSE_LAYOUTS with the comma separated list of profile names (so you better don't use comma in your profile name ;-).
The detailed information is stored in
[HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\EA1200Workspace\BCGPGrids\EA_ELEMENT_LIST_<name>BCGPGrid-0]
where <name> is the according profile name.
For a sample layout here they looked like
"Columns"=hex:11,00,01,00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,01,00,00,00
"ColumnWidth"=hex:11,00,16,00,00,00,04,01,00,00,50,00,00,00,50,00,00,00,50,00,\
00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,\
00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00,50,00,00,00
"ColumnOrder"=hex:08,00,00,00,00,00,01,00,00,00,06,00,00,00,02,00,00,00,0d,00,\
00,00,0e,00,00,00,0f,00,00,00,10,00,00,00
"Groupping"=hex:00,00
"LastFieldChooserPos"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"IsFieldChooserVisible"=dword:00000000
"IsFieldChooserThemed"=dword:00000001
"SortColumns"=hex:00,00
I have to leave that to you to decipher the coding used here. But for a pure ex-/import you probably don't need to do that.

TYPO3/TemplaVoila: Unknown column 'belayout' in 'field list' when adding new Template Object

We're trying to implement a mobile version of our Typo3 site, but whenever I add a new Template Object and select something in "Make this a sub-template of", I get this error:
I'm not very good with typo3, so if anyone could point me in the right direction it would be great. Thanks.
Go to Install Tool > Database Analyser > COMPARE and mark the checkboxes to add missing fields and tables (you don't need to remove suggested things)
Repeat the operation as long as required, if some field can not be added by COMPARE, you need to include it manually via phpMyAdmin. Most probably in such case you'll need to resolve some conflict.
Next go to Extension Manager, find the TemplaVoila ext and search for Update button, to make sure that the config is saved correctly to the file.

how to better use of eclipse code templates (PHP)?

One particular problem I was having was using ${word_selection} in an Eclipse PDT template.
I was recently trying to use some code templates with Eclipse PDT 2.1 to speed up some common tasks. We use a lot of getters/setters, so I wrote the following template.
function get${word_selection}() {
return $$this->getData('${word_selection}');
}
function set${word_selection}($$${word_selection}) {
$$this->setData('${word_selection}', $$${word_selection});
}
I named the template "getset" and the only way I know to use the Code Assist is to type: "getset" then hit my code assist keys (I have it set to Esc, but I think the default was Ctrl+Space). The problem is, this doesn't actually let me select a word to be used by the ${word_selection}.
how do I type in my template name, hit the key combo, and have a word selected all at the same time?
I also want to know what kinds of templates people have set up and any other tips for using templates to speed of programming.
Look at this link : http://2tbsp.com/node/104
It describes two things : pdt code templates and code snippets.
how do I type in my template name, hit the key combo, and have a word selected all at the same time?
I think this cannot be achieved with code templates, but with code snippets. Personnally I do not use them at all, but I might start :-)

poEdit not creating source files

I am using poedit with zend_translate.
I have done everything required in zend. I have created some sample code in zend view files
$this->translate("Hello");
I have then created a new catalog in poedit.
I specified the initial settings (like base directory, translation function)
I edited php parser tab:
a) *.php to *.php;*.phtml
b) adding '-L php'
Then also its not getting any strings.
Anyone has any idea what i am doing wrong.
Under catalog settings, go to "Keywords" and add "translate" — that should fix it.