From a9311de27cdf2c87d2a4a8c5a30dd51d21a015d9 Mon Sep 17 00:00:00 2001 From: Harshal LADHE Date: Wed, 24 May 2023 22:33:52 +0530 Subject: [PATCH 1/2] Added wrapper method for `weekday_select` --- lib/rails_bootstrap_form/inputs.rb | 2 ++ .../inputs/weekday_select.rb | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 lib/rails_bootstrap_form/inputs/weekday_select.rb diff --git a/lib/rails_bootstrap_form/inputs.rb b/lib/rails_bootstrap_form/inputs.rb index b4fda6c..328ae10 100644 --- a/lib/rails_bootstrap_form/inputs.rb +++ b/lib/rails_bootstrap_form/inputs.rb @@ -38,6 +38,7 @@ module Inputs autoload :TimeZoneSelect autoload :UrlField autoload :WeekField + autoload :WeekdaySelect include Base include CheckBox @@ -71,5 +72,6 @@ module Inputs include TimeZoneSelect include UrlField include WeekField + include WeekdaySelect end end diff --git a/lib/rails_bootstrap_form/inputs/weekday_select.rb b/lib/rails_bootstrap_form/inputs/weekday_select.rb new file mode 100644 index 0000000..57755eb --- /dev/null +++ b/lib/rails_bootstrap_form/inputs/weekday_select.rb @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +# -*- frozen_string_literal: true -*- +# -*- warn_indent: true -*- + +module RailsBootstrapForm + module Inputs + module WeekdaySelect + extend ActiveSupport::Concern + + included do + def weekday_select(attribute, options = {}, html_options = {}, &block) + options = {bootstrap_form: {field_class: "form-select"}}.deep_merge!(options) + + field_wrapper_builder(attribute, options, html_options) do + super(attribute, options, html_options, &block) + end + end + end + end + end +end From e557763f189b6ed4b32ced18851776177352c7ea Mon Sep 17 00:00:00 2001 From: Harshal LADHE Date: Wed, 24 May 2023 22:35:23 +0530 Subject: [PATCH 2/2] Bump version to `0.7.1` and updated changelog --- CHANGELOG.md | 5 +++++ Gemfile.lock | 2 +- lib/rails_bootstrap_form/version.rb | 2 +- spec/rails_bootstrap_form_spec.rb | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3da6767..7c32288 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ You can find recent releases with docs in GitHub: https://github.com/shivam091/rails_bootstrap_form/releases +## [0.7.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.7.0...v0.7.1) - 2023-05-24 + +### What's new +- Added wrapper method for `weekday_select`. + ## [0.7.0](https://github.com/shivam091/rails_bootstrap_form/compare/v0.6.2...v0.7.0) - 2023-05-24 ### What's new diff --git a/Gemfile.lock b/Gemfile.lock index c513e17..a498a93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rails_bootstrap_form (0.7.0) + rails_bootstrap_form (0.7.1) actionpack (~> 7.0) activemodel (~> 7.0) diff --git a/lib/rails_bootstrap_form/version.rb b/lib/rails_bootstrap_form/version.rb index b8a3aa4..79da52c 100644 --- a/lib/rails_bootstrap_form/version.rb +++ b/lib/rails_bootstrap_form/version.rb @@ -3,6 +3,6 @@ # -*- warn_indent: true -*- module RailsBootstrapForm - VERSION = "0.7.0".freeze + VERSION = "0.7.1".freeze REQUIRED_RAILS_VERSION = "~> 7.0".freeze end diff --git a/spec/rails_bootstrap_form_spec.rb b/spec/rails_bootstrap_form_spec.rb index 6538133..d237069 100644 --- a/spec/rails_bootstrap_form_spec.rb +++ b/spec/rails_bootstrap_form_spec.rb @@ -6,7 +6,7 @@ RSpec.describe RailsBootstrapForm do it "has a valid version number" do - expect(RailsBootstrapForm::VERSION).to eq("0.7.0") + expect(RailsBootstrapForm::VERSION).to eq("0.7.1") end it "has a valid rails version number" do