=== Release 0.6.3 === New feature: subsites, i.e. namespaced routes, plus support in the controller and view layers. Subsites are created automatically for any directories found in app/controllers. Links default to the current subsite unless you give a subite="..." attribute. The taglib app/views//.dryml is automatically included in every page in the subsite. The out-of-box app is not in great shape in this release, mostly due to problems with the theme. We haven't fixed it because the theme system going to change radically in Hobo 0.7 New version of lowpro, compatible with Prototype 1.6 (rev 267) Change to hobo command: hobo [...options...] app-name instead of hobo app-name [...options...] Migration generator Automatically ignores non-Hobo models (and associated tables) Hobo::Migrations.ignore_models is now deprecated. Use Hobo::Migrations.ignore to list models that should be ignored. The associated tables are ignored too (rarely needed, as these are probably not Hobo models anyway) Hobo::Migrations.ignore_tables is still supported Fix: problems with going back to a nil default from a non-nil default. Hobo model generator In line with Rails 2.0, the timestamps declaration is now included by default (it's generally something every model should have). hobo_base.css Removed over-zealous styling of too many elements. hobo_rapid.css Change of class names for validation errors. hobo_rapid.js Now silently ignores update to non-existent part. This is convenient when parts are being added dynamically, but may prove to be a mistake :-) Global variable controllerNames is gone. Now use calls to Hobo.pluralise. (Gee I guess we should really standardise on American spellings) The 'fade' parameter to removeButton is now an option. Confirmation is now optional too. Hobo.partFor returns the part containing a given element. Used in the new update="self" feature. LowPro behaviour HasManyThroughInput. This is badly named and will change. Core extensions alias_tag_chain is like alias_method_chain but for DRYML tags SafeNil Now more efficient (thanks to "steve d" -- http://coderrr.wordpress.com) Fix when used with DelegateClass New method #implies on booleans. Borrowed from Eiffel. Useful in permission methods. true.implies false #=> false true.implies true #=> true false.implies x #=> true Hash#map_hash. The block is passed only the value if the arity is 1. DRYML The ability to define tags in Ruby is now removed Tag extension: This encapsulates the alias_method_chain pattern. The tag can make a call to to get the old behaviour. alias_current_as is gone -- replaced by extend_with Fix: some DRYML attributes were leaking through to the output HTML part_locals can now be passed instance variable names, e.g. part_locals="@user". Note that inside the part this creates a local variable "user". Don't user @user inside the part. It's just a convenience to avoid the need to do Fix: failure to accumulate CSS class names when merging attributes. DRYML now gives the type returned by #field_type (when available) over this.class Fix: when overriding a parameter, the of the new parameter would incorrectly provide the old tagbody which should have been overridden. hoboParts variable is now set by rather than being hard wired in the output from the DRYML compiler. Fix: caching problems with tags imported by the include_tablib directive. AJAX Parts Calls to parts, along with the part-state variables are now logged. Can now say part="self" when a tag wants to update the part it is contained in (useful for re-usable tags). Rich data types All rich data types now register themselves with Hobo, e.g. class Hobo::EmailAddress < String COLUMN_TYPE = :string ... end Hobo.field_types[:email_address] = Hobo::EmailAddress New type builder - enum_string. e.g. fields do gender enum_string(:male, :female) end You can then do, e.g. if current_user.gender.male? (You also automatically get select menu's in your views) Hobo models In fields declaration: Got rid of weird thing where providing :length meant the type defaulted to :string Can now give classes as well as symbolic names for column types. Mass attribute assignment extended to support some features that were in the model controller. e.g. Dates can be represented as Hashes of month, day etc. Chronic will be used to parse dates if available. Object references (e.g. belongs_to relationships) can be set with "@" as before. "fields do" can optionally be used with a parameter if you don't like the instance_eval hackery: fields do |f| f.name :string end belongs_to can be given :null => false, which is passed through to the migration generator. New method #column returns the meta-data for the named column. #find now returns arrays with a #member_class method def_scope Chained scopes on a class didn't work at all -- now fixed, e.g. Posts.recent.by_author.find(:all) Fix: def_scope with sql parameter interpolation was broken. #changed_fields, which was next to useless, replaced with #only_changed_fields, which is used to assert that only the given fields have changed. Hobo user model The module is renamed from Hobo::AuthenticatedUser to just Hobo::User It is no longer possible to set the login attribute by passing a symbol to hobo_user_model. Go back to using set_login_attr. Didn't work out. It happens sometimes. Helpers #subsite returns the name of the current subsite. #object_url can now be passed the siubsite, e.g. :subsite => "admin" #object_url can only be passed a single hash of options now (could be passed any ammount before) #dom_id now returns "" when a dom_id cannot be generated (used to raise an error) #map_this now works with ranges (used by DRYML's repeat) #current_page_url returns request.request_uri without the query string #query_params now returns a HashWithIndifferentAccess Hobo.dom_id now works better with non-hobo models Permission System Fix: view permission was causing errors with non-hobo models. Now defaults to viewable. Hobo Controller include_tablib accepts symbols as well as strings #redirect_to now forwards all params to object_url when not given a String, Symbol or Hash #hobo_ajax_response no longer need be passed a dryml this Model controller Multiple model creates / updates are gone from the controller layer. Hobo now uses good ol' Rails mass attribute assignment. Coping with multiple object updates should be handled in the model layer. Some features from the model controller have been moved to the model layer, and more will be added in the future. Attempts to automatically re-render the correct page after a validation error on create / update using a form parameter "page_path", which the
tag provides in a hidden field. Previously assumed the form came from the new / edit action. Automatic pagination is now only applied to appropriate mime-types. Add mime-types to Hobo::ModelController.PAGINATE_FORMATS to have them paginated. New declaration 'auto_actions' allows you to select which actions Hobo provides for you automatically. # White list auto_actions :show, :index or # Black list auto_action :all, :except => [ :new_comment ] You can use :collections to add/remove all collection actions in either the black or white list. New declaration 'index_action' declares a new index-like action (similar to show_action) index_action, show_action and web_method can now all be given blocks, rather than defining a method of the same name: show_action :summary do hobo_show Post.find(params[:id], :include => :comments) end Web methods now automatically respond with hobo_ajax_response if the method does not respond. #search Now less magic (i.e. doesn't operate by side-effecting). It now returns a condition string suitable to be passed to :conditions. Can be given a model as the first argument to search on a different model (e.g. for show-collection actions). Fix: :paginate => false was broken #create, #update and #destroy now set flash messages by default (only on "wants.html" requests) used as the default permission denied response. used as the default 404 response. User controller Added various customisation options to login and signup On login, redirect to #home_page -- you can override this on your controllers. The actual name of the login attribute (e.g. "email", "username") is now used in flash messages. hobo_logout can now be given a block to customise the response. Fixes for validation errors on signup. Routing Routes for non-existent actions are not generated. Tag library: Core tags will wrap its content in ther tag specified by tag="..." if when="..." is true. Fix: -- was behaving like Tag library: Rapid now has params