Sha256: 6c4cf1d7818b4412574392478720fdda90c3422a653fdd4df7152e9925c45cd6

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

# scaffold resources
{
  "article" => [
    "name:string",
    "content:text",
    "published:boolean",
  ],
  "comment" => [
    "article:references",
    "content:text",
    "kind:string",
  ],
}.each do |resource, fields|
  generate "scaffold", resource, *fields
  rake "db:migrate"
  inject_into_file "spec/controllers/#{resource.tableize}_controller_spec.rb", after: "RSpec.describe #{resource.pluralize.camelize}Controller, :type => :controller do\n" do
<<-EOF

  before { sign_in_user }
EOF
  end

  gsub_file "spec/controllers/#{resource.tableize}_controller_spec.rb",
      'skip("Add a hash of attributes valid for your model")',
      "FactoryGirl.build(:#{resource}).attributes"
end

run "bundle exec annotate"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crosstie-0.0.2 lib/crosstie/templates/resources.rb