Posts for: #Plugins

Click To Globalize for Rails 2.3

For all of you who don’t know what I’m talking about, **Click to Globalize** is a Rails plugin for in-place translations. Now it’s compatible with Rails 2.3 and It’s also the most clean and polish version of ever, let me explain what’s changed.

Engine

Yes, **Click to Globalize** is now an [engine](http://rails-engines.org/), this means all the controllers, the helpers, the routes and the other stuff, now lives in `vendor/plugins`. No more clutter with flying files, except for one javascript and one stylesheet.

I18n

The [i18n team](http://i18n-rails.org/) (myself included) worked hard to build a **consistent API** for i18n. Starting from Rails 2.2 we have bundled a gem for this purpose, and now my plugin is totally compliant with this system, this **agnosticism** allow you to use whatever i18n backend you want. Click to Globalize is **no longer a Globalize extension!!**

RESTful

The plugin now bundles two **full RESTful** controllers: `TranslationsController` and `LocalesController`, respectively `/translations` and `/locales`.

Lightweight

I replaced the annoying `around_filter` system, with a more lightweight one, based on the observation of `ActionView#render`.

Formatting

I removed the support for **Markdown** and **Textile**, personally I never used so much, and don’t think they are so related with i18n.

Deprecations

The old `globalize?` method is deprecated in favor of `in_place_translations?`.

You can find all the new instructions to the [project page](http://lucaguidi.com/projects/click-to-globalize) or on [GitHub](http://github.com/jodosha/click-to-globalize).
Enjoy!

[]

Rake tasks for run Rails engines migrations

I created a patch for run engine’s migrations

~

I created a patch for run engine’s migrations, it adds two Rake tasks:

  • db:migrate:engines
  • db:migrate:engines:down

The first one allows to run all the migrations stored in the db/migrate directory of each plugin. It runs migrations in the same order Rails::Initializer register the plugins, this means if you force an order by environment.rb, it will be reflected on migrations order.

Example: You have four plugins in your app: apple, bar, foo, pear.

[]

Cached Models 0.0.3

Since I began to work as professional developer I learned a lot of stuff, but, first of all I learned to be honest with customers and with the Community. I have to admit: CachedModels 0.0.2 was a huge mess.

It was a broken version, due to wrong mocks in test. I apologize for all the problems you could encountered using it. Since I discovered all the errors, I worked hard to restore all the lost functionalities. But it wasn’t enough for me, so I focused my attention on performances, reducing cache accesses: now benchmark test tooks 36.015132 fewer seconds than plain ActiveRecord!

[]

Cached Models 0.0.2

CachedModels hit 0.0.2.

First of all, I transformed it to a Ruby gem, so you can use it outside Rails! Second, I dramatically enhanced performances, avoiding useless cache lookups and expirations. Take a look at the new benchmark stats: 1000 requests with a level of concurrency equal to 100, tooks 6 fewer seconds, if compared with standard ActiveRecord.

I strongly encourage you to upgrade to the newer version.

[]