Skip to content

Instantly share code, notes, and snippets.

Avatar

Catalin Ionescu cionescu

View GitHub Profile
View create_events.rb
create_table :events do |t|
t.datetime :start_date, null: false
t.datetime :end_date, null: false
t.references :user, foreign_key: true, index: true
t.references :client, foreign_key: true, index: true
t.timestamps
end
@cionescu
cionescu / auto_annotate_models.rake
Created Jun 13, 2020
Annotate models configuration
View auto_annotate_models.rake
# NOTE: only doing this in development as some production environments (Heroku)
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if Rails.env.development?
require 'annotate'
task :set_annotation_options do
# You can override any of these by setting an environment variable of the
# same name.
Annotate.set_defaults(
'active_admin' => 'false',