Rails Icon

Rails

Ruby on Rails (Rails) is a web application framework written in Ruby.
85 Stories
All Topics

Ruby changelog.com/posts

active_attr - the stuff ActiveModel left out

Newcomers to Rails often discover too late that not all application models have to be ORM-backed. There are a number of reasons why you might not need or want to persist your models in a data store. Perhaps you want to roll your own persistence layer. In those scenarios, you might miss some conveniences of ActiveRecord-based models. While ActiveModel has made models more consistent between ActiveRecord, Mongoid, and other ORMs, it doesn’t cover every ActiveRecord feature. Bridging this gap is the inspiration behind ActiveAttr, a project from Chris Griego. ActiveAttr lets you define attributes: class Person include ActiveAttr::Attributes attribute :first_name attribute :last_name end person = Person.new person.first_name = "Chris" person.last_name = "Griego" person.attributes #=> {"first_name"=>"Chris", "last_name"=>"Griego"} … with defaults class Person include ActiveAttr::Attributes attribute :first_name, :default => "John" attribute :last_name, :default => "Doe" end person = Person.new person.first_name #=> "John" person.last_name #=> "Doe" … even specify assignment security: class Person include ActiveAttr::MassAssignmentSecurity attr_accessor :first_name, :last_name attr_protected :last_name end person = Person.new(:first_name => "Chris", :last_name => "Griego") person.first_name #=> "Chris" person.last_name #=> nil ActiveAttr also supports logging, typecasting, and more. Check out the source on GitHub for more info or to contribute.

read more

Ruby changelog.com/posts

Rails 3.2 RC1 released, now with Active Record Store

The Rails team has released a release candidate for Rails 3.2, the last major version supporting Ruby 1.8.7: Rails 3.2.x is planned to be the last 3.x release branch. rails/master is now 4.0.0.beta and will only support Ruby 1.9.3+. Farewell 1.8.7!— DHH (@dhh) December 20, 2011 Among the list of changes, the Active Record Store caught my eye: class User < ActiveRecord::Base store :settings, accessors: [ :color, :homepage ] end u = User.new(color: 'black', homepage: '37signals.com') u.color # Accessor stored attribute u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor I’ve long used Rails Settings in many projects. It’ll be nice to have this baked in.

read more

Ruby changelog.com/posts

Rails gets automatic EXPLAIN logging for slow SQL queries

In a fresh commit, Rails edge now has the ability to automatically add query plan info to the standard Rails logger: # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) config.active_record.auto_explain_threshold_in_seconds = 0.5 … which will yield something like: +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ | 1 | SIMPLE | users | const | PRIMARY | PRIMARY | 4 | const | 1 | | | 1 | SIMPLE | posts | ALL | NULL | NULL | NULL | NULL | 1 | Using where | +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ 2 rows in set (0.00 sec) Hot.

read more

Ruby changelog.com/posts

A few tools to craft JSON output in a Ruby web app API

It seems a solid API that returns JSON is almost a prerequisite for any new web app these days. Often these JSON data structures return nested associated data, composed from several models in the system. There has been some discussion this week around tools and approaches to building JSON data structures in a Ruby web app API. Perhaps the biggest buzz this week has been around Jbuilder which DHH announced on Twitter. While the world doesn’t need another J_Anything_, it does provide a nice API that can be used stand alone from controllers or as a view template: Jbuilder.encode do |json| json.content format_content(@message.content) json.(@message, :created_at, :updated_at) json.author do |json| json.name @message.creator.name.familiar json.email_address @message.creator.email_address_with_name json.url url_for(@message.creator, format: :json) end if current_user.admin? json.visitors calculate_visitors(@message) end ... end … which produces: { "content": "<p>This is <i>serious</i> monkey business", "created_at": "2011-10-29T20:45:28-05:00", "updated_at": "2011-10-29T20:45:28-05:00", "author": { "name": "David H.", "email_address": "'David Heinemeier Hansson' <david@heinemeierhansson.com>", "url": "http://example.com/users/1-david.json" }, "visitors": 15 ... } Another promising gem is Boxer from the team at Gowalla. While tied more closely to ActiveRecord and Rails, Boxer lets you define multiple views for an object, allowing you to expose extended attributes, usually based on permissions: Boxer.box(:user) do |box, user| box.view(:base) do { :name => user.name, :age => user.age, } end box.view(:full, :extends => :base) do { :email => user.email, :is_private => user.private?, } end end Finally John Nunemaker shared his thoughts learned building the Gaug.es API on his popular Rails Tips blog. John uses the Presenter pattern to craft the JSON output. For even more projects in this space, check out the JBuilder README which provides a list of resources at the bottom. The most mature of these looks to be RABL from Nathan Esquenazi.

read more

Ruby changelog.com/posts

Bundler 1.1.rc is out!

If you do any work with Ruby and Rails, then you’ve (probably) grown to love Bundler, an awesome gem that resolves the dependencies for all your other gems. The bundler team has been working hard on a new release, and they’d love for some people to try it out. I’ve linked to the changelog for the 1.1 release here, but the biggest change is that it actually uses the RubyGems API, so bundling is much, much faster. You can get it by typing $ gem install bundler --pre If you find any issues, please report them on their bug tracker. [README] [CHANGELOG]

read more

Ruby changelog.com/posts

letmein: Minimalistic authentication plugin for Rails 3 apps

If Devise/Warden/etc. still do too much for your taste, check out LetMeIn, a less-is-more approach to the age old problem of AuthN. There are no built-in routes/controllers/views/helpers or anything. I’m confident you can do those yourself, because you’re awesome. In this case, minimalistic doesn’t mean a lack of features. I love the way <class_name>Session objects are created for you based on the models you’ve configured: LetMeIn.configure do |conf| conf.models = ['User', 'Admin'] conf.attributes = ['email', 'username'] end Check out the entertaining README for details.

read more

Rails changelog.com/posts

Sprockets 2.0 is out!

After 15 beta releases, Sprockets has finally released the big 2.0. Why’s this a big deal? Well, Sprockets is the gem that’s powering the new asset pipeline in Rails 3.1. It can automatically process, minify, combine, and serve all of your assets in a variety of formats. If you’re using Rails, I’d recommend upgrading your application to Rails 3.1. Even though it’s still just an RC release, the final is about to come very soon. Then, sprockets is all set up for you. If you’re not on Rails, then you should check out this awesome blog post by Envy Labs. It’ll get you going. Of course, you don’t need to use the Git URL now that version 2 is out. Check out the source on GitHub and the readme for more details.

read more

Rails changelog.com/posts

Rails 3.1 Hackfest next weekend on IRC and IRL!

NEXT weekend this weekend, there’s going to be a hackfest for Rails 3.1! If you’ve wanted to contribute to Rails in the past but you were too intimidated, now you have a chance to get involved, meet your heros and make a few friends along the way! Members of the Rails core team as well as core contributors will be hanging out on IRC. Don’t hesitate to ask whatever questions you may have. Who Core Team Members: Aaron Patterson (tenderlove) Xavier Noria (fxn) Santiago Pastorino (spastorino) Core Contributors: Damien Mathieu (dmathieu) Prem Sichanugrist (sikachu) Josh Kalderimis (joshk) When The weekend of July 23rd and 24th, 2011 Where On IRC: Server: irc.freenode.net Channel: #rails-contrib In real life? Outside of this, there will be some get togethers of people (in real life) hacking on Rails, if you’d prefer that. There are a number of places that have confirmed meeting places for this gathering and they are listed on the official Rails blog. More details? Get all the details on this hackfest at the official Rails blog. Happy hacking!

read more

JavaScript changelog.com/posts

Remotipart - Rails 3 AJAX file uploads made easy

I’ll be honest: I hate uploading files. It shouldn’t be hard, but it always is, because there are so many details. The core case is so simple: You just need an <input> with the file type. Then you forget to make your form multipart, or configure your webserver to not time out for large files, or you want a progress indicator… The last one is always AJAX. AJAX, AJAX, AJAX. If you’ve had to write this yourself, you know that you end up doing silly stuff with iframe injection, and it always feels so sloppy. Well, that’s why remotipart exists. It doesn’t get rid of the base issue (we’ll leave that up to the standards people), but it does make it super, ultra, mega easy to turn your regular upload form into an AJAX one. Three steps: install the gem, add :remote => true to your form options, and wrap your response with a remotipart_response block. Here’s the full example, from the README: sample_layout.html.erb <%= form_for @sample, :html => { :multipart => true }, :remote => true do |f| %> <div class="field"> <%= f.label :file %> <%= f.file_field :file %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> sample_controller.rb def create respond_to do |format| if @sample.save format.js end end end create.js.erb <%= remotipart_response do %> // Display a Javascript alert alert('success!'); <% if remotipart_submitted? %> alert('submitted via remotipart') <% else %> alert('submitted via native jquery-ujs') <% end %> <% end %> That simple. Bam. I love Rails 3’s unobtrusive Javascript.

read more

JavaScript changelog.com/posts

Summer Breeze: creates dynamic Rails fixtures for Jasmine tests

On stage at Red Dirt Ruby Conference, Noel Rappin has released Summer Breeze, a gem that makes working with Jasmine in Rails a bit easier. Summer Breeze dynamically creates Rails fixtures for your Jasmine tests. Installation and usage To install via RubyGems: gem install summer_breeze … and run the bundled generator: rails generate summer_breeze:install Now you can define you fixtures in the generated initializer: fixture "PostsController##index.body_container" You then have several options for telling Jasmine about your new fixture: sb.loadFixture(fixture_name) sb.findSelector(fixture_name, selector) sb.readFixture(fixture_name) A sample test might look like: it("hides text when asked", function() { $form_container = sb.findSelector('login', '.form_container'); toggle_handlers.init(); $hide_link = $form_container.find(".toggle_link"); expect($hide_link).not.toHaveClass("hidden"); $hide_link.click(); expect($hide_link).toHaveClass("hidden"); }); Be sure and check the Readme for advanced usage and limitations. [Source on GitHub]

read more

Ruby changelog.com/posts

pow: Zero-configuration Rack server for Mac OS X

I’ve been a long-time Passenger user to switch between multiple Ruby web apps during development without needing to crank up rails s for each. When I began using RVM to switch back and forth between multiple Ruby versions, Passenger no longer solved my problem. That’s why I’m excited to try out Pow from 37 Signals. Pow aims to be “a zero-config Rack server for Mac OS X.” To install, run the install script curl get.pow.cx | sh To add apps, just symlink them to your ~/.pow folder: $ cd ~/.pow $ ln -s /path/to/myapp … and browse to http://myapp.dev/. [Source on GitHub] [Annotated Source]

read more

Ruby changelog.com/posts

navigasmic: Semantic navigation for Rails

Site navigation isn’t rocket surgery. But how many times have you gone down this route? You plop that <ul> into your header and then add <li>’s with each of your site navigation links. Then you need to make one of them highlighted based on the current page. Suddenly your nice clean view code gets a lot less readable as you handle conditional logic for setting the highlighted state, not to mention any sub navigation for the selected item. Try as you might to pull as much code into view helpers as you can, straddling the line between Haml or ERB and Ruby helpers never quite seems like a clean fit. Jeremy Jackson has created an elegant solution with Navigasmic which aims to be simple, customizable, and pleasant to use while using less code than it generates. It features: A clean API, leading to cleaner views Support for Haml and ERB Nested site navigation Highlighted states Disabled states XML sitemaps Installation To install Navigasmic, configure the gem in your Gemfile gem "navigasmic" … and run bundle install In your view, use the semantic_navigation helper method to build your navigation. Here’s an example: - semantic_navigation :main do |n| = n.group 'Media', :html => {:class => 'media'} do = n.item 'Image Gallery', :link => {:controller => 'media/images'} = n.item 'Videos', :link => {:controller => 'media/videos'} = n.group 'Info' do = n.item 'About Us', :link => '/about_us', :html => {:title => 'we are the coolest'} = n.item 'Nothing Here' This produces the following HTML: <ul id="main" class="primary semantic-navigation"> <li id="media" class="with-group"> <span>Media</span> <ul> <li id="image_gallery"><a href="/media/images"><span>Image Gallery</span></a></li> <li id="videos"><a href="/media/videos"><span>Videos</span></a></li> </ul> </li> <div class="secondary"> <li id="info" class="with-group"> <span>Info</span> <ul> <li id="about_us"> <a href="/about_us"><span>About Us</span></a> <ul> <li id="nothing_here"><span>Nothing Here</span></li> </ul> </li> </ul> </li> </div> </ul> Highlighting One of the most powerful Navigasmic features is the range of highlighting options: - semantic_navigation :main do = n.item 'Image Gallery', :link => 'media/images' :highlights_on => [{:controller => 'media'}, /images/, proc { Time.now.wday == 1 }] Simply pass an array of options as :highlights_on including url_for options, strings, Regexes, even Ruby procs. If the highlighting criteria is met, the <li> gets a highlighted CSS class: <ul id="main" class="semantic-navigation"> <li id="image_gallery" class="highlighted"><a href="/media/images"><span>Image Gallery</span></a></li> </ul> Be sure and check the Readme for advanced usage including disabling options, XML sitemaps, and more. [Source on GitHub]

read more

Ruby changelog.com/posts

comfortable-mexican-sofa: Tiny yet powerful micro CMS for Rails 3

When writing up this project, a CMS from GBH at TWG, I felt a bit like Robin Williams’ character in Good Morning Vietnam when he said. Excuse me, sir. Seeing as how the VP is such a VIP, shouldn’t we keep the PC on the QT? ‘Cause if it leaks to the VC he could end up MIA, and then we’d all be put out in KP. Comfortable Mexican Sofa, from Oleg Khabarov AKA @GroceryBagHead at The Working Group, is a nifty engines-based Content Management System you can drop into any Rails 3 app. What struck me the most is the clean {{ }}-style tag syntax you’re probably used to in Mustache, Tumblr, or ExpressionEngine: {{ cms:page:content:text }} ‾ tag format or extra attributes ‾‾‾‾‾‾‾ label/slug/path for the tag, ‾‾‾‾‾‾‾‾‾‾‾‾ tag type (page, field, snippet, helper, partial) ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ cms tag identifier Usage To use CMS, configure the gem in your Gemfile: config.gem 'comfortable_mexican_sofa' … and run bundle install. Next, run the supplied generator to create the required database migrations and initializer, and migrate up. rails g cms rake db:migrate Now you can start creating layouts, pages, snippets, and other content in the supplied admin interface: CMS can share your existing application layouts and CMS content can even be served up inside of regular Rails views: def show @help = HelpTopic.find(params[:id]) # CMS page probably should have either helper or partial tag to display @help details render :cms_page => '/help' end Even the admin panel is extensible, just have your admin controllers inherit from CMS’s BaseController: class Admin::CategoriesController < CmsAdmin::BaseController # your code goes here end If you simply need to extend the admin UI, try using the view hooks: ComfortableMexicanSofa::ViewHooks.add(:navigation, '/admin/navigation') Be sure and check the extensive Readme for advanced usage, especially for the tag syntax. [Source on GitHub] [Discuss on Hacker News]

read more

Ruby changelog.com/posts

railsready: Setup script to get Ruby and Rails running on Ubuntu with one command

How would you like to get a full Ruby on Rails stack up on Ubuntu with one command? Now you can by running Rails Ready. Rails Ready is a setup script that gets Ruby and Rails running on a fresh install of Ubuntu with one command (Tested on Ubuntu server 10.04 LTS (Long-term Support)). This is a brand new project by Josh Frye that he uses all the time to setup VMs, but there’s always testing to be done and improvements to be made. Fork as needed or join in on the conversation at Hacker News. Running the Script Check out railsready.sh to see everything Rails Ready is doing. sudo wget --no-check-certificate https://github.com/joshfng/railsready/raw/master/railsready.sh && bash railsready.sh The script will then ask if you want to build Ruby from source or install RVM. If you want to watch the magic happen just run tail -f ~/railsready/install.log. What gets installed? An updated system Ruby 1.9.2p136 (installed to /usr/local/bin/ruby) or RVM running 1.9.2p136 Imagemagick libs needed to run Rails (sqlite, mysql, etc) Bundler, Passenger, and Rails gems Git All you need to do is install NGINX or Apache, run passenger-install-nginx-module or passenger-install-apache-module, upload your app, point your vhost config to your apps public directory and go! [Source on GitHub] [Comment on Hacker News]

read more

Rails changelog.com/posts

OpenGovernment: Empower individuals and organizations to track government at every level

When 9 Trillion dollars goes missing from the Federal Reserve and the Federal Inspector General can’t explain the details of that missing money, what can “we” the people do about it? (See a visualization of 1 Trillion Dollars) Watch this YouTube video to learn more about this insane debacle. Sadly, Alan Grayson (the questioner) never asked the simple closed-ended question, “So, is that a Yes or No?”. However, collectively, we can ask that question if we have open access to government data. While OpenGovernment may not provide the answer to that specific question directly, it will certainly provide a level of government transparency like we’ve never seen before at the state, city, local and international levels. What is OpenGovernment? OpenGovernment is an open-source Ruby on Rails application for aggregating and presenting open government data, and it is based on OpenCongress.org, the most-visited not-for-profit site for tracking the federal U.S. Congress. As a joint project of two 501(c)3 non-profit organizations, the Participatory Politics Foundation and the Sunlight Foundation, OpenGovernment will empower individuals and organizations to track government at every level. A ‘beta’ version of OpenGovernment is planned to launch this month (January 2011) with information for five state legislatures: California, Louisiana, Maryland, Texas, and Wisconsin. Moving forward, they are looking for non-profit funding to extend civic engagement to all 50 U.S. states, major cities, other countries, and beyond. Just as OpenCongress has grown to become a popular community site for watchdogging the U.S. Congress, OpenGovernment will empower individuals and organizations to track government at every level. And like OpenCongress, OpenGovernment is a non-partisan public resource, independent from any government entity or political party. How can I give my support? You can support the open-source work on OpenGovernment by becoming a Booster of the non-profit Participatory Politics Foundation (a tax-exempt recurring donation of $1/day), giving a one-time charitable gift, or by forking the code on GitHub and start hacking. Their biggest limiting factor isn’t ideas, or a lack of valuable government info to make accessible, but rather web development time. There’s a huge wish list of data & features for this open-source community site, so hop in #opengovernment on irc.freenode.net, or join their Google Group to get in touch. Also, the project’s README is super thorough in setting up the application to start hacking. Special thanks to Jeremy Ashkenas for this tweet about OpenGovernment’s Rails model for legislature.rb. class Legislature < ActiveRecord::Base has_one :upper_chamber has_one :lower_chamber has_many :chambers has_many :committees has_many :primary_committees, :class_name => 'Committee', :conditions => 'committees.votesmart_parent_id is null' has_many :sub_committees, :class_name => 'Committee', :conditions => 'committees.votesmart_parent_id is not null' has_many :lower_committees has_many :upper_committees has_many :joint_committees belongs_to :state validates_uniqueness_of :name validates_presence_of :name has_many :sessions CONGRESS = Legislature.find_by_name("United States Congress") MAJOR_PARTIES = ["Democrat", "Republican"] end [Source on GitHub] [Homepage] [Comment on Hacker News]

read more

Ruby changelog.com/posts

RailsAdmin - Rails 3 engine to view your data

I am super pumped about RailsAdmin. It’s a Ruby Summer of Code project by Bogdan Gaza. But apparently not just him, as he tweeted: So what’s it do? Let’s let a screenshot do the talking: Yep. Super simple access to view, edit and search all of the models in your Rails 3 application. It’s incredibly easy to install, put this in your Gemfile: gem 'devise' # Devise must be required before RailsAdmin gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git' and then run this: $ bundle install $ rails generate rails_admin:install_admin Hitting http://localhost:3000/admin will take you to the panel, after you rails server, of course. RailsAdmin uses the standard ‘config method that takes a block’ pattern to configure itself. RailsAdmin.config do |config| config.model Team do list do field :name field :created_at end end end There are approximately 1 zillion options, too. You can check them all out in the project’s README file. [Source on GitHub] [Readme] [A presentation on Slidshare]

read more

Ruby changelog.com/posts

t-minus: Instant prelaunch page for your Rails3 app

Let’s say you want to generate some buzz for your app as you develop. It would be nice to have a splash page to collect email signups and then quickly take down when the site is ready. If you’re running Rails 3, John Grimes has made it a snap with T-minus, a Rails engine that provides a splash page and signup form. The app collects email signups and even has Campaign Monitor integration built-in. To get started, add T-minus to your Gemfile gem "t-minus" … and then bundle:install. Now you can run the supplied generator: rails generate t_minus:install Edit your database settings in the generated config/prelaunch_config.yml and then migrate up: rake db:migrate If you want to customize the model or controller, you can generate those, too, to override the supplied gem versions: rails generate t_minus:controller rails generate t_minus:model When your app is finally ready for primetime, simply set active to false in config/prelaunch_config.yml. [Source on GitHub]

read more

Ruby changelog.com/posts

oauth2_provider: Make your Rails app an OAuth v2.0 provider

With the likes of Facebook, GitHub, Gowalla, and others adopting OAuth 2.0, client libraries have been popping up everywhere. If you want to join the cool kids and OAuth2-enable your API, where do you start? ThoughtWorks Studios has released oauth2_provider, a Rails plugin to provide OAuth2 authentication to your app. Install via RubyGems: $ gem install oauth2_provider … and configure via Bundler. Next, run the supplied generator to create the initializer and migrations: $ ./script/generate oauth2_provider Enable OAuth support alongside your regular authentication in your ApplicationController: class ApplicationController < ActionController::Base # the host application's authentication filter before_filter :login_required # include Oauth2::Provider::ApplicationControllerMethods include Oauth2::Provider::ApplicationControllerMethods # this checks whether the user is logged in for purposes # of an authentication filter. obviously, your host application # will have very different code than this. this example is # pulled from the sample host application with which the plugin ships. def login_required current_user_id = session[:user_id] if current_user_id User.current = User.new(current_user_id) else raise "Lack of rights!" end end # required by the OAuth plugin to figure out the currently logged in user # must be a string representation of the user. # A 'username', 'email' or a db primary key are good candidates. protected def current_user_id_for_oauth super end def login_required_with_oauth if user_id = self.user_id_for_oauth_access_token session[:user_id] = user_id elsif looks_like_oauth_request? render :text => "Denied!", :status => :unauthorized else login_required_without_oauth end end alias_method_chain :login_required, :oauth end By default, controller actions are not OAuth’d, so you have to opt-in, perhaps with a intermediate controller class: class ProtectedResourceController < ApplicationController # Supported options are: # :only => [:oauth_protected_action...] # :except => [:oauth_unprotected_action...] # If no options are specified, defaults to oauth for all actions oauth_allowed :only => :index def index render :text => "current user is #{current_user.email}" end def no_oauth_here render :text => "this content not available via Oauth" end end [Source on GitHub]

read more

Ruby changelog.com/posts

That app is Phat

We all know the Rails Can’t Scale line to be bunk, but that doesn’t mean we stop looking for ways to speed up Rails apps. Mike Perham says his apps are Phat, and yours can be, too. Phat is a Rails app pattern that employs a single Thread, multiple Fiber model in Ruby 1.9 to async-ify an otherwise vanilla Rails app behind Thin. Phat uses rack-fiber_pool, Mike’s Rack Middleware to execute each request in a Fiber. Phat also configures Fiber-enabled async libraries including em_postgresql, memcache-client, and em-resolv-replace to achieve some impressive scalability: # Asynchronous DNS lookup require 'em-resolv-replace' require 'rack/fiber_pool' # Pull in the evented memcache-client. # You'll need to configure config.cache_store as normal. require 'memcache/event_machine' Rails::Initializer.run do |config| config.cache_store = :mem_cache_store # Run each request in a Fiber config.middleware.use Rack::FiberPool # Get rid of Rack::Lock so we don't kill our concurrency config.threadsafe! end [Source on GitHub] [Mike’s Blog Post]

read more

Ruby changelog.com/posts

Shop til you drop: Spree hits 0.10.0

Spree, the leading Rails storefront project, has released version 0.10.0 with some big new changes: Named scopes and product groups Pluggable search (with extension support for Xapian, Sphinx and Solr.) Theming New and improved multi-step checkout Improved gateway configuration Multiple payment methods Refunds and credits SEO improvements RESTful API Support for Rails 2.3.5 and Ruby 1.9 The docs have also been refreshed to cover the new enhancements. If you’re new to Spree, take a test drive. If you need a more custom storefront, you can join the ranks of 300+ forks on the Hub. [Source on GitHub] [New since 0.9.4]

read more

Rails changelog.com/posts

Mongrations - migrations for MongoMapper

Why would a schema-less database need migrations? Simple: to help you keep old data fresh as you change your data format. Recently added new columns to your MongoMapper model and need to update old values in your MongoDB collection? Terry Heath gives you Mongrations: script/generate mongration update_followers_count_for_existing You’ll get a new file with the familiar Rails migration format: class UpdateFollowersCountForExisting < MongoMapper::Mongration def self.up end def self.down end end Just add your own code to manipulate your data and call rake db:mongrate. Mongrations include rake tasks for db:mongrate:redo, db:mongrate:up, db:mongrate:down, db:mongrate:rollback. [Source on GitHub] [Blog post]

read more

0:00 / 0:00