14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/generators/chive/seeds_generator.rb', line 14
def manifest
append_to_file 'db/seeds.rb' do
<<-RUBY
# Chive examples
if Rails.env.development?
user = #{options[:user].camelize}.create(name: 'Example', email: 'example@example.com', password: 'password')
Chive::#{options[:article].camelize}.create(
title: 'Hello, World!',
body: %(
<p>This is an example article created by the development seeds (db/seeds.rb).</p>
),
author: user,
status: 'publish',
published_at: DateTime.now
)
end
RUBY
end
end
|