I'm having problems creating some factories, when the database was created someone called a field of a table like "end" now when I try to build the factory when i I type end and then try to assign a value it takes that en as the end of the factory not as an atribute of the table.
Any Idea of how can I fix it?
I think you are trying to use a reserved
word as an attribute name in your factory definitions. This is how you can do it:
factory :enrique_table do
add_attribute(:end) { 'just the beginning' }
end
add_attribute
method let's you define attributes with reserved
words. If you like to learn more about FactoryBot
, head over to their Getting Started guide.
Hope it helps.