Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub fields in Rails model generator #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Stub fields in Rails model generator #58

wants to merge 1 commit into from

Conversation

ches
Copy link

@ches ches commented Oct 9, 2010

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
Copy link
Author

ches commented Jul 30, 2011

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
Copy link

wulftone commented Oct 5, 2011

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.

None yet

2 participants