Add following to Gemfile
group :development, :test do
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-minitest' # or gem 'rubocop-rspec' depending on your test suite
end
require "rails_helper" | |
RSpec.describe DateRangeSplitter, type: :service do | |
describe "#generate_split_dates" do | |
it "#splits dates properly exclusive in ranges" do | |
from = DateTime.now | |
to = from + 53.days | |
splitter = DateRangeSplitter.new(from, to, 10, end_inclusive: false) | |
splitter.each do |from_d, to_d| | |
check_against = to_d == to ? 3 : 10 |
import React from 'react' | |
import { Checkbox } from '@shopify/polaris' | |
export default function CheckboxAdapter({ input, meta, ...rest }) { | |
return ( | |
<Checkbox | |
{...input} | |
{...rest} | |
error={meta.touched && meta.error} | |
onChange={(value) => { |
Add following to Gemfile
group :development, :test do
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-minitest' # or gem 'rubocop-rspec' depending on your test suite
end
# Transforms | |
# From: enum name: values | |
# To: enum :name, values, validate: { allow_nil: true } | |
# Also removes _ from prefix and suffix for the new syntax to avoid un-intended bugs | |
# You can modify this tranformer in transform_enum method as per your needs | |
# USAGE: | |
# 1. gem install parser | |
# 2. run this file providing a single file or parent folder like: ruby tranform_enums.rb myApp/app/models OR ruby tranform_enums.rb myApp/app/models/user.rb |