Why: Its a really huge script, and conflicts are hard to resolve on forks, with indivudal scripts its easier to make custom changes. How: Following @mariacheca example using require_relative and a file under the db/dev_seeds/ folder
12 lines
582 B
Ruby
12 lines
582 B
Ruby
section "Hiding debates, comments & proposals" do
|
|
Comment.with_hidden.flagged.reorder("RANDOM()").limit(30).each(&:hide)
|
|
Debate.with_hidden.flagged.reorder("RANDOM()").limit(5).each(&:hide)
|
|
Proposal.with_hidden.flagged.reorder("RANDOM()").limit(10).each(&:hide)
|
|
end
|
|
|
|
section "Confirming hiding in debates, comments & proposals" do
|
|
Comment.only_hidden.flagged.reorder("RANDOM()").limit(10).each(&:confirm_hide)
|
|
Debate.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide)
|
|
Proposal.only_hidden.flagged.reorder("RANDOM()").limit(5).each(&:confirm_hide)
|
|
end
|