paulelliott/fabrication-site

reserved words

Closed this issue · 3 comments

One of my models has an 'alias' attribute. How would I define that attribute in a fabricator? If I do so with the normal block syntax, ruby gets confused because 'alias' is actually a ruby keyword.

You can pass a block variable and reference fields through that.

Fabricator(:widget) do |f|
  f.alias "something"
end

Thank you, I just realized I posted this on the wrong repo!

I just updated the docs to reflect this as well. Thanks for pointing it out.

c7f2626