title: undefined method `i18n_key' for Address:Class
body: <p>I get this error when I load a page that contains a form (like edit.html.erb or new.html.erb). It freezes on the labels. I need to underline that I am not using ActiveRecord as an ORM in my app but Perpeuity gem which is an implementation of the Datamapper pattern. Leaving Activerecord behind has proved a bit problematic so maybe someone will be able to help.</p>
  
  <p>The form partial:</p>
  
  <pre><code>&lt;%= form_for(@address) do |f| %&gt;
  &lt;% if @address.errors.to_a.any? %&gt;
      &lt;div id="error_explanation"&gt;
        &lt;h2&gt;&lt;%= pluralize(@address.errors.count, "error") %&gt; prohibited this address from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
          &lt;% @address.errors.full_messages.each do |msg| %&gt;
              &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
          &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
  &lt;% end %&gt;
  
  &lt;div class="row collapse"&gt;
    &lt;div class="small-3 columns"&gt;
      &lt;% require 'debugger'; debugger %&gt;
      &lt;%= f.label :line1, class: "right inline" %&gt;
    &lt;/div&gt;
    &lt;div class="small-7 columns left"&gt;
      &lt;%= f.text_field :line1 %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="row collapse"&gt;
    &lt;div class="small-3 columns"&gt;
      &lt;%= f.label :line2, class: "right inline" %&gt;
    &lt;/div&gt;
    &lt;div class="small-7 columns left"&gt;
      &lt;%= f.text_field :line2, :placeholder =&gt; "(optional)"  %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row collapse"&gt;
    &lt;div class="small-3 columns"&gt;
      &lt;%= f.label :postcode, class: "right inline" %&gt;
    &lt;/div&gt;
    &lt;div class="small-7 columns left"&gt;
      &lt;%= f.select :postcode, Address::POSTCODES, :prompt =&gt; 'Select a postcode (optional)' %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row collapse"&gt;
    &lt;div class="small-3 columns"&gt;
      &lt;%= f.label :city, class: "right inline" %&gt;
    &lt;/div&gt;
    &lt;div class="small-7 columns left"&gt;
      &lt;%= f.text_field :city %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row collapse"&gt;
    &lt;div class="small-3 columns"&gt;
      &lt;%= f.label :county, class: "right inline" %&gt;
    &lt;/div&gt;
    &lt;div class="small-7 columns left"&gt;
      &lt;%= f.select :postcode, Address::COUNTIES, :prompt =&gt; 'Select a county (optional)' %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="row collapse"&gt;
    &lt;div class="small-9 small-offset-3 columns"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  
  
  <p>The model:</p>
  
  <pre><code>class Address
    extend ActiveModel::Naming
    extend ActiveModel::Translation
    include Perpetuity::RailsModel
  
    def errors
      @errors ||= ActiveModel::Errors.new(self)
    end
  
    def read_attribute_for_validation(attr)
      send(attr)
    end
  
   def save
     validate!
     errors.empty? ? super : false
   end
  
   def validate!
     #place custom validations here e.g.
     errors.add(:name, "cannot be blank.") if self.name = ""
     errors.add(:number,"must be less than 7.") if self.number &gt;= 7
   end
  
   attr_accessor :name, :city, :county, :line1, :line2, :postcode
   attr_reader   :errors
  
  end
  </code></pre>
  
  <p>The controller with relevant methods:</p>
  
  <pre><code>class AddressesController &lt; ApplicationController
  
    def new
      @address = Address.new
  
      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @address }
      end
    end
  
    def edit
      #require 'debugger'; debugger
      @address = Perpetuity[Address].find(params[:id])
    end
  
    def create
      @address = Address.new(params[:address])
      Perpetuity[Address].insert @address
  
      respond_to do |format|
        if @address.save
          format.html { redirect_to @address, notice: 'Address was successfully created.' }
          format.json { render json: @address, status: :created, location: @address }
        else
          format.html { render action: "new" }
          format.json { render json: @address.errors, status: :unprocessable_entity }
        end
      end
    end
  
    def update
      @address = Perpetuity[Address].find(params[:id])
  
      respond_to do |format|
        if @address.update_attributes(params[:address])
          format.html { redirect_to @address, notice: 'Address was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: "edit" }
          format.json { render json: @address.errors, status: :unprocessable_entity }
        end
      end
    end
  end
  </code></pre>
  
  <p>I am using Rails 3.2 and ActiveModel gem installed has version 3.2.13. I had a look at the gem code and cannot find method i18n_key in it, while this documentation here [link]<a href="http://www.rubydoc.info/docs/rails/3.1.1/ActiveModel/Name:i18n_key" rel="nofollow">http://www.rubydoc.info/docs/rails/3.1.1/ActiveModel/Name:i18n_key</a> indicates that it should be in there (similarly it is in 3.2.8 docs). Is it a bug or am I doing something wwrong? Thank your for your help.</p>