Method: FixtureFactory::Methods#create
- Defined in:
- lib/fixture_factory/methods.rb
#create(name, overrides = {}) ⇒ Object
Generates a persisted model instance given a factory name and an optional hash of override attributes.
Example
create(:user) create(:blog, title: ‘Riding Rails’) create(:comment, content: ‘Hello’, approved: false) create(:post, comments: [create(:comment)])
70 71 72 73 74 |
# File 'lib/fixture_factory/methods.rb', line 70 def create(name, overrides = {}) FixtureFactory.create( name, overrides: overrides, context: self, scope: self.class ) end |