{"id":746,"date":"2010-02-12T17:05:24","date_gmt":"2010-02-12T19:05:24","guid":{"rendered":"http:\/\/blog.plataformatec.com.br\/?p=746"},"modified":"2010-02-12T17:05:24","modified_gmt":"2010-02-12T19:05:24","slug":"happy-birthday-devise","status":"publish","type":"post","link":"https:\/\/blog.plataformatec.com.br\/2010\/02\/happy-birthday-devise\/","title":{"rendered":"Happy Birthday Devise"},"content":{"rendered":"
Today we are celebrating Devise<\/a>‘s birthday. But wait, if you have started watching Devise<\/a> since the beginning you may be asking: has Devise<\/a> already completed one year of life? Nope. Today we are completing exactly 4 months since Devise<\/a> was released at Rails Summit Latin America 2009<\/a>. And we are very proud and glad to say that we have just reached version 1.0<\/a>! Yeah! Let’s celebrate and talk a bit about history.<\/p>\n We decided to build Devise<\/a> based on some requirements we had in a project last year. The majority of our projects usually require an admin interface to configure the application with some CRUD information. And in this specific project, we were needing two different roles in the same application, the admin itself with all its powers to manage the application, and the end users that should be signed in to do some stuff inside the application. Usually only one model would be required in this situation, with some “type” column or flag to determine if the user is an admin or not, right? Okay, but we didn’t like this approach that much. So we started looking at some of the possibilities:<\/p>\n Okay, we could pick one of these and with a bit of extra work we would achieve our requirements. But would we need to do it every time this situation happens? We said no. It’s not DRY enough. And we like DRY. So Devise<\/a> was born.<\/p>\n The main objective of the first Devise<\/a> version was to get up and running the entire sign in process, including password recovery and confirmation stuff. And everything should work with different roles, which mean you could easily plug and play an Admin, User, Account, or whichever role you needed, in your application, without much effort. And we had a deadline: Rails Summit<\/a>. It took almost 1 month of work before Rails Summit<\/a>. I still remember the days before the event, we putting a lot of effort to have Devise<\/a> up and running, and the README<\/a> being written during the event. So, we were ready there and presenting Devise<\/a> to the world.<\/p>\n Devise<\/a> was born with the intuit of handling different roles without effort, automatically, and it is achieved with Rails Engines. In addition, Devise<\/a> is build in top of Warden<\/a>, a great rack authentication framework. It allowed us to be flexible enough and add different strategies, hooks, and modules easily. In short, Devise<\/a>:<\/p>\n Devise<\/a> has started with the basic modules needed for that specific application: <\/p>\n Okay, everything we needed were there. Everything else was in a wish list, nicely called TODO. And we decided from the beginning to not add features to Devise<\/a> until us or somebody else really needed them. But people asked, people needed new features. And they were always there to help, to fork and fix a bug, to comment. We started soon to add new features, the first was:<\/p>\n After people were asking for easier ways to create their migrations, so we introduced a new module with Devise<\/a> 0.2:<\/p>\n To help people getting up and running faster, we created some generators. Now they are:<\/p>\n Devise<\/a> 0.3 and 0.4 came soon after, with a lot of bug fixes in generators, I18n, initialization, some deprecations and a bunch of code refactored.<\/p>\n Contributions from community were coming more and more. The first big contribution came with the addition of encryptors. Nowadays Devise<\/a> supports encrypting passwords with SHA1, SHA512, and BCrypt. It has also support for using the same encryptors as Authlogic<\/a>, Clearance<\/a> and Restful Authentication<\/a>, to help you migrating from these solutions.<\/p>\n At this point we thought: okay, that should be enough. It wasn’t. People needed different ORMs, other than ActiveRecord<\/a>. So we introduced support to MongoMapper<\/a> and then we were reaching Devise<\/a> 0.5.<\/p>\n We were receiving a lot of issues with functional tests, so we introduced some test helpers to help people with the sign in\/out process in this kind of tests called Devise::TestHelper.<\/p>\n As applications grow, more roles may be needed. So we created the possibility to scope your views for each role\/scope in your application. This way your user can have a different sign in view than the admin, for example. Reaching Devise<\/a> 0.6, a lot of improvements on routes and DataMapper<\/a> support were added.<\/p>\n We were full of nice ideas to add new features, and our TODO was bigger than we like. So we came up with:<\/p>\n Also the loading process and ORM support received a lot of work before launching Devise<\/a> 0.7.<\/p>\n For Devise<\/a> 0.8 we looked at tests for MongoMapper<\/a> and the code got a great review. Also some work was done to get Devise<\/a> up and running with latest version of Warden<\/a> and its new features, such as serializers. We also extracted a new base module from Confirmable:<\/p>\n We were receiving a lot of feedback from the community, and then we merged a cool new feature:<\/p>\n Following the same pattern from Rails in this commit<\/a> we moved flash messages to Devise<\/a> 1.0 introduces a lot of cool features. The community seems to be really appreciating Devise<\/a>, and we’ve received another great contribution:<\/p>\n In addition, we created the two most requested features for Devise<\/a>:<\/p>\n We also added the possibility to use Migratable while editing a table using We are preparing a new release of Devise<\/a> fully compatible with Rails 3. It means Devise<\/a> has now closed its development for new features in Rails 2.x. We are still going to maintain a 1.0 branch in github for bug fixes to keep everything up and running.<\/p>\n We would like to say thank you to everyone who has helped us achieve 1.0 version and who is using Devise<\/a>, testing, creating issues, and giving all this feedback.<\/p>\n Also, for those who were at Rails Summit<\/a> last year, we proposed something: get the biggest number of watchers on github as fast as possible! When we presented Devise<\/a>, there were 7 watchers, and if I am right we were 4 of them. At the time of this writing we have 762 watchers. Yeah! I think I can take the risk and say we accomplished it. Thanks!<\/p>\n Let’s celebrate Devise<\/a> 1.0, and look forward to see Devise<\/a> and Rails 3. Enjoy!<\/p>\n Happy birthday Devise<\/a>! <\/p>\n","protected":false},"excerpt":{"rendered":" Today we are celebrating Devise‘s birthday. But wait, if you have started watching Devise since the beginning you may be asking: has Devise already completed one year of life? Nope. Today we are completing exactly 4 months since Devise was released at Rails Summit Latin America 2009. And we are very proud and glad to … \u00bb<\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[37,36,39,23,7],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/746"}],"collection":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/comments?post=746"}],"version-history":[{"count":43,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/746\/revisions"}],"predecessor-version":[{"id":802,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/posts\/746\/revisions\/802"}],"wp:attachment":[{"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/media?parent=746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/categories?post=746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.plataformatec.com.br\/wp-json\/wp\/v2\/tags?post=746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}The beginning<\/h3>\n
\n
How it works<\/h3>\n
\n
The road so far<\/h3>\n
\n
\n
\n
t.authenticatable<\/code>,
t.confirmable<\/code> and so on.<\/li>\n<\/ul>\n
\n
script\/generate devise_install<\/code><\/strong>: create devise initializer file to enable some configs and copy default locale file.<\/li>\n
script\/generate devise<\/strong> MyModel<\/code>: create a model with setup for Devise<\/a>, routes and migration.<\/li>\n
script\/generate devise_views<\/strong><\/code>: copy all Devise<\/a> views to your app\/views folder, so you can change it as needed.<\/li>\n<\/ul>\n
\n
\n
\n
:notice<\/code> and
:alert<\/code>, and released Devise<\/a> 0.9. Step by step the 1.0 version was coming.<\/p>\n
What is new<\/h3>\n
\n
\n
change_table<\/code>, among other fixes.<\/p>\n
What comes next<\/h3>\n
In the end<\/h3>\n