adzap / validates_timeliness

Date and time validation plugin for ActiveModel and Rails. Supports multiple ORMs and allows custom date/time formats.
MIT License
1.59k stars 227 forks source link

Remove #setup method, which is deprecated in Rails 4. #117

Closed johncarney closed 8 years ago

johncarney commented 10 years ago

Defining #setup on Validators is deprecated in Rails 4.1 and is planned to be removed altogether in Rails 4.2. In the meantime, defining setup causes deprecation warnings.

This patch is cribbed from a couple of suggested solutions discussed in issue #114 and suppresses deprecation warnings in Rails 4.1 and will work in Rails 4.2, as well as older versions.

I haven't included any tests because I couldn't figure out how to cleanly mimic the different behaviours of different Rails versions.

ischuster commented 10 years ago

It'd be nice if you execute this pull requeste. Tks.

axlekb commented 10 years ago

Seems like @adzap has gone dark. Maybe you can find him @johncarney, since you're both in Melbourne. Would love to get rid of those deprecation warnings.

adzap commented 10 years ago

@axlekb Yes, I had gone dark. I will spare you the excuses. Getting back on to OSS stuff now. I will doing more on this in the next week or so.

axlekb commented 10 years ago

:smile:

axlekb commented 10 years ago

@adzap, how's this looking? :love_letter:

vendethiel commented 10 years ago

Thanks @johncarney, switched to your branch :star2:

johncarney commented 10 years ago

No worries @Nami-Doc :)

jnevelson commented 10 years ago

Is there an ETA on getting this merged in?

tranvictor commented 10 years ago

@johncarney Why do you have to use ActiveRecord to retrieve the version? Your patch wouldn't work if people use other ORMs such as Mongoid, would it?

johncarney commented 10 years ago

Good point @tranvictor. I've modified it to use ActiveModel instead.

johncarney commented 10 years ago

Sorry to bug you @adzap, any chance you could take a look at this? Or is it time to pass the baton? I'd be happy to step in as maintainer if you're too busy.

axlekb commented 10 years ago

@adzap, come back! Please! Now been 5+ weeks.

dugsmith commented 10 years ago

:+1:

ghost commented 10 years ago

Perhaps it is time to pass on the responsibility of this gem or create a new, since adzap hasn't responed to the proposed fix.

@johncarney, since you have volunteered as maintainer, would you mind creating a new gem with your fix?

Hopefully, you can a helping hand from the community.

ischuster commented 10 years ago

I'd be nice. I'm already using the @johncarney's branch in my Gemfile in order to resolve this issue. :)

2014-07-06 17:45 GMT-03:00 Urbanviking notifications@github.com:

Perhaps it is time to pass on the responsibly of this gem or create a new, if adzap hasn't responed to the proposed fix.

@johncarney https://github.com/johncarney, since you volunteer as maintainer, would you mind to create a new gem with your fix to this issue?

Hopefully, you can a helping hand from the community with this.

— Reply to this email directly or view it on GitHub https://github.com/adzap/validates_timeliness/pull/117#issuecomment-48126546 .

ghost commented 10 years ago

@Ivan, please would you post instructions on how can I use @johncarney's branch in my gemfile?

While this is a good workaround, I don't think that the long-term solution should be using a branch as finale version.

Regards, Dan Jensen

www.fitbird.com www.facebook.com/fitbirdinc

E-mail dj@fitbird.com Mobile +45 4159 5752 (Denmark) Mobile +1 917 2081834 (USA)

On Sun, Jul 6, 2014 at 5:00 PM, Ivan H. Schuster notifications@github.com wrote:

I'd be nice. I'm already using the @johncarney's branch in my Gemfile in order to resolve this issue. :)

2014-07-06 17:45 GMT-03:00 Urbanviking notifications@github.com:

Perhaps it is time to pass on the responsibly of this gem or create a new, if adzap hasn't responed to the proposed fix.

@johncarney https://github.com/johncarney, since you volunteer as maintainer, would you mind to create a new gem with your fix to this issue?

Hopefully, you can a helping hand from the community with this.

— Reply to this email directly or view it on GitHub < https://github.com/adzap/validates_timeliness/pull/117#issuecomment-48126546>

.

— Reply to this email directly or view it on GitHub https://github.com/adzap/validates_timeliness/pull/117#issuecomment-48126971 .

dsandstrom commented 10 years ago

@Urbanviking Add to gemfile:

gem 'validates_timeliness', github: 'johncarney/validates_timeliness', branch: 'remove-deprecated-setup-method'

Another problem with switching to @johncarney's fork is that we will be missing the open issues in this repo.

johncarney commented 10 years ago

I'm happy to publish my own version of this gem. I'll do that some time this week. We can manually copy issues over.

ischuster commented 10 years ago

Great !!!

2014-07-07 1:38 GMT-03:00 John Carney notifications@github.com:

I'm happy to publish my own version of this gem. I'll do that some time this week. We can manually copy issues over.

— Reply to this email directly or view it on GitHub https://github.com/adzap/validates_timeliness/pull/117#issuecomment-48140443 .

johncarney commented 10 years ago

For those that are interested, I've published my version of this gem.

gem "jc-validates_timeliness"

Details are at https://github.com/johncarney/validates_timeliness. Feel free to add issues, create pull requests, etc. Over the coming weeks I'll look at copying over outstanding on this repo.

ischuster commented 10 years ago

Good news! Thanks!

2014-07-16 9:36 GMT-03:00 John Carney notifications@github.com:

For those that are interested, I've published my version of this gem.

gem "jc-validates_timeliness"

Details are at https://github.com/johncarney/validates_timeliness. Feel free to add issues, create pull requests, etc.

— Reply to this email directly or view it on GitHub https://github.com/adzap/validates_timeliness/pull/117#issuecomment-49158690 .

ghost commented 10 years ago

Thanks John. This is awesome.

Are you including a reference to former gem, so folks know that older is no longer maintained?

Regards, Dan Jensen

www.fitbird.com www.facebook.com/fitbirdinc

E-mail dj@fitbird.com Mobile +45 4159 5752 (Denmark) Mobile +1 917 2081834 (USA)

On Wed, Jul 16, 2014 at 10:14 AM, Ivan H. Schuster <notifications@github.com

wrote:

Good news! Thanks!

2014-07-16 9:36 GMT-03:00 John Carney notifications@github.com:

For those that are interested, I've published my version of this gem.

gem "jc-validates_timeliness"

Details are at https://github.com/johncarney/validates_timeliness. Feel free to add issues, create pull requests, etc.

— Reply to this email directly or view it on GitHub < https://github.com/adzap/validates_timeliness/pull/117#issuecomment-49158690>

.

— Reply to this email directly or view it on GitHub https://github.com/adzap/validates_timeliness/pull/117#issuecomment-49171164 .

johncarney commented 10 years ago

@Urbanviking: yes, there's a link to the original in the README, though it's at the bottom. I might move it up to the top.

ghost commented 10 years ago

Cool. That's awesome. Thank you.

Regards, Dan Jensen

www.fitbird.com www.facebook.com/fitbirdinc

E-mail dj@fitbird.com Mobile +45 4159 5752 (Denmark) Mobile +1 917 2081834 (USA)

On Wed, Jul 16, 2014 at 10:32 AM, John Carney notifications@github.com wrote:

@Urbanviking https://github.com/Urbanviking: yes, there's a link to the original in the README, though it's at the bottom. I might move it up to the top.

— Reply to this email directly or view it on GitHub https://github.com/adzap/validates_timeliness/pull/117#issuecomment-49173914 .

gvc commented 10 years ago

This gem is super useful and @johncarney is awesome!

JuanitoFatas commented 10 years ago

Could this one merge in? It would be great! Thanks!

wafcio commented 10 years ago

+1

dgmike commented 10 years ago

Waiting for this merge too :+1:

ericraio commented 10 years ago

@johncarney thanks!! :+1:

crabbits commented 10 years ago

:+1:

blueplanet commented 10 years ago

:+1:

benjaminoakes commented 10 years ago

Thanks @johncarney!

masarakki commented 9 years ago

:+1:

phlegx commented 9 years ago

:+1:

adzap commented 8 years ago

Well gang, so very long overdue, I have release v4 with Rails 4.x support.

Huge thanks to @johncarney et al. for keeping the project going. Sorry for the disappearance and epic slowness.

Hopefully gives gets us back on track. Please report any new issues as you find them.