Class: Decidim::Pages::Seeds
- Inherits:
-
Object
- Object
- Decidim::Pages::Seeds
- Defined in:
- lib/decidim/pages/seeds.rb
Instance Attribute Summary collapse
-
#participatory_space ⇒ Object
readonly
Returns the value of attribute participatory_space.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(participatory_space:) ⇒ Seeds
constructor
A new instance of Seeds.
Constructor Details
#initialize(participatory_space:) ⇒ Seeds
Returns a new instance of Seeds.
10 11 12 |
# File 'lib/decidim/pages/seeds.rb', line 10 def initialize(participatory_space:) @participatory_space = participatory_space end |
Instance Attribute Details
#participatory_space ⇒ Object (readonly)
Returns the value of attribute participatory_space.
8 9 10 |
# File 'lib/decidim/pages/seeds.rb', line 8 def participatory_space @participatory_space end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/decidim/pages/seeds.rb', line 14 def call component = Decidim::Component.create!( name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :pages).i18n_name, manifest_name: :pages, published_at: Time.current, participatory_space: ) Decidim::Pages::Page.create!( component:, body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do Decidim::Faker::Localized.paragraph(sentence_count: 3) end ) end |