class Person
def initialize(age)
@age = age
end
def is_how_many_younger_than(other_person)
age - other_person.age
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attributes: | |
# - primary_key | |
- foreign_key | |
- content | |
- inheritance | |
disconnected: true | |
filename: erd | |
filetype: pdf | |
indirect: true | |
inheritance: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /spec/support/capybara.rb | |
# Add the following line in rails_helper.rb to load this configuration. | |
# | |
# require_relative 'support/capybara' | |
# | |
require 'capybara/rspec' | |
require 'capybara-screenshot/rspec' | |
RSpec.configure do |config| | |
# Test Drivers - https://everydayrails.com/2018/01/08/rspec-3.7-system-tests.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks | |
# The "main" locale. | |
base_locale: en | |
## All available locales are inferred from the data by default. Alternatively, specify them explicitly: | |
locales: [en, ja, zh-CA, zh-TW] | |
## Reporting locale, default: en. Available: en, ru. | |
internal_locale: en | |
# Read and write translations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "bootstrap"; | |
@import "font-awesome"; | |
// Fix the issue that this block does not show | |
// https://github.com/twbs/bootstrap/issues/23454#issuecomment-468657049 | |
.invalid-feedback { | |
display: block; | |
} | |
// Section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/tasks/dev.rake | |
if Rails.env.development? | |
namespace :dev do | |
desc 'Drop, create, load schema, migrate, seed, and populate sample data' | |
task prepare: ['db:drop', 'db:create', 'db:schema:load', | |
'db:migrate', 'db:seed', :populate_sample_data] do | |
puts 'Ready to go!' | |
end | |
desc 'Populates the database with sample data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Macro Style Methods style guide (DRAFT) | |
# | |
# Let me know if you have a good idea! This is still a draft. | |
# | |
# Reference: https://github.com/rubocop-hq/rails-style-guide#macro-style-methods | |
class User < ActiveRecord::Base | |
include Sortable | |
extend SomethingSpecial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example | |
NAME = "this is constant" | |
SECRET_NAME = "this is a secret name" | |
private_constant :SECRET_NAME | |
def self.foo | |
@foo ||= "this is foo" | |
end | |
def self.bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/bulma_form_builder.rb | |
# There are a few things to mention: | |
# 1) See the article at the URL for sample code with screenshots and more information. | |
# URL: https://medium.com/@dyanagi/a-bulma-form-builder-for-ruby-on-rails-applications-aef780808bab | |
# 2) This may not have covered all form controls. | |
# Form builder for Bulma | |
# Reference: https://bulma.io/documentation/form/ | |
class BulmaFormBuilder < ActionView::Helpers::FormBuilder |
OlderNewer