:(( After dig deeper to use Rails Engines & login_engine. I read this note
Ruby on Rails 2.3 Release Notes
Rails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering, more efficient routing, application templates, and quiet backtraces. This list covers the major upgrades, but doesn’t include every little bug fix and change. If you want to see everything, check out the list of commits in the main Rails repository on GitHub or review the CHANGELOG files for the individual Rails components.
=> rails engines plugin is out
This defines attr_accessors at a class level instead of instance level.
class Foo
cattr_accessor :greeting
end
Foo.greeting = "Hello"
This could be compared to, but is not the same as doing this:
class Bar
class << self
attr_accessor :greeting
end
end
Bar.greeting = "Hello"
The difference might not be apparent at first, but cattr_accessor will make the accessor inherited to the instances:
Foo.new.greeting #=> "Hello"
Bar.new.greeting # NoMethodError: undefined method `greeting' for #
This inheritance is also not copy-on-write in case you assumed that:
Foo.greeting #=> "Hello"
foo1, foo2 = Foo.new, Foo.new
foo1.greeting = "Hi!"
Foo.greeting #=> "Hi!"
foo2.greeting #=> "Hi!"
This makes it possible to share common state (queues, semaphores, etc.), configuration (max value, etc.) or temporary values through this.