Compatibility with Rails 3.0.x

20 views
Skip to first unread message

Alex Agranov

unread,
Jun 3, 2013, 1:35:43 PM6/3/13
to fabrica...@googlegroups.com
Hi all,

I'm on a project that can't quite move past Rails 3.0.x at the moment but I've managed to convince them to move to at least Ruby 1.9.x and get off 1.8.

This required moving up the fabrication gem from 1.1.2 to the 2.x series but it looks like 2.0.1 is the highest I can go.

It appears that this version of `build_instance' introduced on 2.0.2,
 
lib/fabrication/generator/active_record.rb:

def build_instance
  self._instance = _klass.new(_attributes, without_protection: true)
end


breaks backward compatibility with Rails 3.0.x by passing the hash for the second argument.

Just thought you'd like to know in case you want to update your documentation.

cheers,

-a

Paul Elliott

unread,
Jun 3, 2013, 2:19:33 PM6/3/13
to fabrica...@googlegroups.com
Instead of updating the docs, I decided to update the code to work the way it should. Version 2.7.2 of fabrication will no longer pass without_attributes unless AR version is 3.1 or 3.2 so hopefully it will work for you. Thanks for reporting this!

-- Paul

--
You received this message because you are subscribed to the Google Groups "fabrication" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabricationge...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alex Agranov

unread,
Jun 3, 2013, 5:24:09 PM6/3/13
to fabrica...@googlegroups.com
Mighty fine, thanks!

-a
Reply all
Reply to author
Forward
0 new messages