Compare commits

...

13 Commits

Author SHA1 Message Date
Adam Meehan
d0fcf754ec Update build to ruby 2.5.3 and fix sqlite 2019-02-09 12:15:58 +11:00
Adam Meehan
7233ff66dd v5.0.0.alpha4 2019-02-09 12:00:31 +11:00
Adam Meehan
f0ba09f278 relax timeliness dependency, assuming semver 2019-02-09 11:57:31 +11:00
Adam Meehan
80ee285b3a bump minimum timeliness version 2019-02-03 11:58:11 +11:00
Adam Meehan
cf20576253 readme version bump 2018-07-31 09:08:42 +10:00
Adam Meehan
f39fbb0ad2 v5.0.0.alpha3
Bump with fixed file permissions only.
2018-07-31 09:07:09 +10:00
Adam Meehan
67106b0212 bump gem version in readme 2018-07-02 21:13:24 +10:00
Adam Meehan
bc6d4fe5fc v5.0.0.alpha2 2018-07-02 21:12:12 +10:00
Adam Meehan
70335cd0ba Use prepend for Type overrides /ht @jasl closes #179 2018-07-02 21:08:47 +10:00
Adam Meehan
af406cdedc remove old sqlite-ruby gem. Thanks @jasl 2018-07-02 21:08:47 +10:00
Adam Meehan
837de0d212 v5.0.0.alpha1 2018-07-02 21:08:47 +10:00
Adam Meehan
116930d633 Merge pull request #178 from xMartin/patch-1
update README with actually working 5.x gem version
2018-06-28 09:43:40 +10:00
xMartin
f025d58073 update README with actually working 5.x gem version 2018-06-27 11:22:40 +02:00
7 changed files with 28 additions and 29 deletions

View File

@@ -8,7 +8,7 @@ gemfile:
- gemfiles/rails_5_2.gemfile
rvm:
- "2.5.1"
- "2.5.3"
script: 'bundle exec rspec'

View File

@@ -1,5 +1,8 @@
= [UNRELEASED]
* Fix DateTimeSelect extension support (AquisTech)
* Relaxed Timeliness dependency version which allows for >= 0.4.0 with
threadsafety fix for use_us_formats and use_euro_formats for hot switching
in a request.
Breaking Changes
* Update Multiparameter extension to use ActiveRecord type classes with multiparameter handling

View File

@@ -8,9 +8,5 @@ gem 'rspec-rails', '~> 3.7'
gem 'timecop'
gem 'byebug'
gem 'appraisal'
gem 'sqlite3'
gem 'sqlite3', '~> 1.3.6'
gem 'nokogiri', '~> 1.8'
group :active_record do
gem 'sqlite3-ruby', :require => 'sqlite3'
end

View File

@@ -30,7 +30,7 @@ If you a looking for the old version for Rails 4.x go here [https://github.com/a
== Installation
# in Gemfile
gem 'validates_timeliness', '~> 5.0.0.pre'
gem 'validates_timeliness', '~> 5.0.0.alpha3'
# Run bundler
$ bundle install

View File

@@ -9,36 +9,36 @@ module ValidatesTimeliness
end
end
ActiveModel::Type::Date.class_eval do
# Module.new do |m|
def cast_value(value)
return super unless ValidatesTimeliness.use_plugin_parser
ActiveModel::Type::Date.prepend Module.new {
def cast_value(value)
return super unless ValidatesTimeliness.use_plugin_parser
if value.is_a?(::String)
return if value.empty?
value = Timeliness::Parser.parse(value, :date)
value.to_date if value
elsif value.respond_to?(:to_date)
value.to_date
else
value
end
if value.is_a?(::String)
return if value.empty?
value = Timeliness::Parser.parse(value, :date)
value.to_date if value
elsif value.respond_to?(:to_date)
value.to_date
else
value
end
# end.tap { |mod| include mod }
end
end
}
ActiveModel::Type::Time.class_eval do
ActiveModel::Type::Time.prepend Module.new {
def user_input_in_time_zone(value)
if value.is_a?(String) && ValidatesTimeliness.use_plugin_parser
return super unless ValidatesTimeliness.use_plugin_parser
if value.is_a?(String)
dummy_time_value = value.sub(/\A(\d\d\d\d-\d\d-\d\d |)/, Date.current.to_s + ' ')
Timeliness::Parser.parse(dummy_time_value, :datetime, zone: :current)
else
value.in_time_zone
end
end
end
}
ActiveModel::Type::DateTime.class_eval do
ActiveModel::Type::DateTime.prepend Module.new {
def user_input_in_time_zone(value)
if value.is_a?(String) && ValidatesTimeliness.use_plugin_parser
Timeliness::Parser.parse(value, :datetime, zone: :current)
@@ -46,4 +46,4 @@ ActiveModel::Type::DateTime.class_eval do
value.in_time_zone
end
end
end
}

View File

@@ -1,3 +1,3 @@
module ValidatesTimeliness
VERSION = '5.0.0-pre'
VERSION = '5.0.0.alpha4'
end

View File

@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "LICENSE"]
s.add_runtime_dependency(%q<timeliness>, ["~> 0.3.8"])
s.add_runtime_dependency(%q<timeliness>, [">= 0.3.10", "< 1"])
end