Class: Decidim::Sortitions::Seeds
- Inherits:
-
Object
- Object
- Decidim::Sortitions::Seeds
- Defined in:
- lib/decidim/sortitions/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/sortitions/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/sortitions/seeds.rb', line 8 def participatory_space @participatory_space end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/decidim/sortitions/seeds.rb', line 14 def call Decidim::Component.create!( name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :sortitions).i18n_name, manifest_name: :sortitions, published_at: Time.current, participatory_space: ) end |