If I might make a suggestion regarding the version_three, version_four,
version_20X6 nonsense (which it admittedly is), might it not make more
sense to literally compare the activemodel major version against 3?

Gem.loaded_specs['activemodel'].version.to_s.split('.').first == '3'


On Fri, Nov 29, 2013 at 11:24 PM, Nicolas Viennot
<notifications@github.com>wrote:

> In lib/nobrainer.rb:
>
> > @@ -31,9 +31,24 @@ def connect(uri)
> >
> >
> >      def rails3?
> > -      return @rails3 unless @rails3.nil?
> > -      @rails3 = Gem.loaded_specs['activemodel'].version >= Gem::Version.new('3') &&
> > -                Gem.loaded_specs['activemodel'].version <  Gem::Version.new('4')
> > +      @rails3 ||= within_minimum_version && within_maximum_version
>
> My brain can parse the 3 lines methods in around 3 seconds. This is easy
> for me to see what's going on and spot a bug.
>
> The 18 lines version is complete overkill and hard to maintain down the
> line. I have to read more stuff.
> You introduce new words that my brain has to parse.
>
> Also, should we make a new method like version_three, for every single
> version? this doesn't make sense.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/nviennot/nobrainer/pull/25/files#r8009966>
> .
>



-- 
SO not teh 1337