![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
- What is Localtower?
Localtower is a Rails Engine mountable in development environment to help you generate migrations for your Rails application.
It's like ActiveAdmin or Sidekiq UI.
You plug it in your config/routes.rb
and it works out of the box.
Check the Installation section below for more details.
- How Localtower works?
Localtower gives you a UI to create models and migrations. It will generate a migration file like you would do with rails generate migration add_index_to_users
. You will see the generated file in db/migrate/
folder.
- Why creating a UI for Rails migrations?
Rails migrations are well documented in the official Rails Guides but we often tend to forget some commands or do typo errors. Like writing add_index :user, :email
instead of add_index :users, :email
(did you spot the typo?). Working from a UI with a fixed list of commands reduces the chance of making errors.
- When I'm using Localtower, can I still generate migrations from the command line?
Of course! Localtower does not lock you up. You can still generate migrations like you did before. Localtower is just a migration generator. You can also generate a migration from Localtower and then edit it manually before running rails db:migrate
- What does happen when I want to remove Localtower?
You just have to remove the gem from your Gemfile
, run bundle
, remove the engine in config/routes.rb
, and that's it! All your previous migrations will stay in db/migrate/
. You are never locked up with Localtower. You can install or uninstall anytime. Remember, it is just a UI to generate files. Do not hesitate to open an issue on Github and tell me why you don't want it anymore. It will be very valuable for me to understand what I can do better ❤.
- Cool, but there are some migration options that are not available in Localtower, what can I do?
Localtower doesn't implement all the Rails Migrations API. I focused on the most common scenarios. If you need to do something tricky in your migrations, you can still edit the migrations manually. You are also welcome to open an issue on Github to ask for a specific feature. I'm always open to extend the possibilities of Localtower.
Please use the best localtower version: >= 2.0.0
See installation process below.
Compatibility:
Add to your Gemfile
file:
group :development do
gem 'localtower', '~> 2.0'
end
Run command in your terminal:
bundle install
Add to your config/routes.rb
:
MyApp::Application.routes.draw do
if Rails.env.development?
mount Localtower::Engine, at: 'localtower'
end
# Your other routes here:
# ...
end
⚠ IMPORTANT ⚠
Change your config/environments/development.rb:
Rails.application.configure do
# This is the default:
# config.active_record.migration_error = :page_load
# Change it to:
config.active_record.migration_error = false if defined?(Localtower)
# ...
end
If you know how to override this configuration in the gem instead of doing it in your app code, please open an issue and tell me your solution.
To access the UI, run your local rails server and open your browser at http://localhost:3000/localtower.
It will create a migration file:
It will generate a migration file:
Now, we add a Book
model:
Every action made from the UI will generate native Rails migration files.
Exactly like the rails generate
command.
But instead of generating files in the console, they are generated in the db/migrate
folder.
The models:
The migration files:
The final schema:
I recommend you to upgrade to the latest version which is 2.0.0
.
To upgrade, just use the latest version of Localtower.
You have nothing else to do.
bundle update localtower
Thanks for reporting issues, I'll do my best to fix the bugs 💪
If you want to contribute to the gem:
Create a spec/dummy/.env
file with the credentials to your PostgreSQL Database. It should look like this:
LOCALTOWER_PG_USERNAME="admin"
LOCALTOWER_PG_PASSWORD="root_or_smething"
drop / create database:
cd spec/dummy
bundle exec rails db:drop
bundle exec rails db:create
rm app/models/*.rb
Run the spec:
bundle install
bundle exec rspec spec/
Only for official contributors.
git tag vX.X.X # change by last version
git push --tags
rm *.gem
gem build localtower.gemspec
gem push localtower-*.gem
Do not hesitate to open issues if you have troubles using the gem.
FAQs
Unknown package
We found that localtower demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.