Skip to content

Experience CS: Update name of ten-block-mission project and consistently use sentence case for project names #544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions lib/tasks/projects.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace :projects do
identifier: 'experience-cs-example',
locale: 'en',
project_type: Project::Types::SCRATCH,
name: 'Experience CS Example',
name: 'Experience CS example',
user_id: nil
},
{
Expand All @@ -27,35 +27,46 @@ namespace :projects do
identifier: 'ten-block-mission',
locale: 'en',
project_type: Project::Types::SCRATCH,
name: '10 Block Mission',
name: 'Ten block mission',
user_id: nil
},
{
identifier: 'blank-scratch-starter',
locale: 'en',
project_type: Project::Types::SCRATCH,
name: 'Blank Scratch Starter',
name: 'Blank Scratch starter',
user_id: nil
},
{
identifier: 'lets-explore-scratch',
locale: 'en',
project_type: Project::Types::SCRATCH,
name: "Let's Explore Scratch",
name: "Let's explore Scratch",
user_id: nil
},
{
identifier: 'transforming-sprites',
locale: 'en',
project_type: Project::Types::SCRATCH,
name: 'Transforming Sprites',
name: 'Transforming sprites',
user_id: nil
}
]
projects.each do |attributes|
identifier = attributes[:identifier]
if Project.unscoped.exists?(attributes.slice(:identifier, :locale))
project = Project.only_scratch(true).find_by(attributes.slice(:identifier, :locale))
if project.present?
puts "Scratch project with identifier '#{identifier}' already exists"
project.assign_attributes(attributes.except(:identifier, :locale))
if project.changed?
if project.save
puts "Scratch project with identifier '#{identifier}' updated successfully"
else
puts "Scratch project with identifier '#{identifier}' update failed"
end
else
puts "Scratch project with identifier '#{identifier}' has not changed"
end
elsif Project.create(attributes)
puts "Scratch project with identifier '#{identifier}' created successfully"
else
Expand Down