Skip to content

Stub fields in Rails model generator#58

Open
ches wants to merge 1 commit into
notahat:masterfrom
ches:model-attribute-generation
Open

Stub fields in Rails model generator#58
ches wants to merge 1 commit into
notahat:masterfrom
ches:model-attribute-generation

Conversation

@ches

@ches ches commented Oct 9, 2010

Copy link
Copy Markdown

Greetings Pete,

I've updated the Rails model generator to create some defaults for fields, like so:

$ rails g model Foo title:string date:datetime
...
$ cat spec/support/blueprints.rb 
require 'machinist/active_record'

# Add your blueprints here.
#
# e.g.
#   Post.blueprint do
#     title { "Post #{sn}" }
#     body  { "Lorem ipsum..." }
#   end

Foo.blueprint do
  title { "MyString" }
  date { "2010-10-09 16:44:25" }
end

Thanks for creating Machinist :-)

@ches

ches commented Jul 30, 2011

Copy link
Copy Markdown
Author

Hey Pete,

Just perusing my old open pull requests and saw this, so thought I'd bump it. Still using this little hack in my projects :-)

@wulftone

wulftone commented Oct 5, 2011

Copy link
Copy Markdown

I like this hack. Bump!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants