Skip to content

Instantly share code, notes, and snippets.

@jdickey
Last active December 15, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdickey/5185614 to your computer and use it in GitHub Desktop.
Save jdickey/5185614 to your computer and use it in GitHub Desktop.
Description and support files for rails_admin Issue #1569. See https://github.com/sferik/rails_admin/issues/1569 for issue report and discussion.

My app has, among others, an Article model and a User model. The Article model includes the line

belongs_to :author, class_name: 'User'

This would allow me to, for example, get the author's name via anArticle.author.name. The relevant ActiveRecord documentation indicates that :class_name is used to "[s]pecify the class name of the association", and gives a directly relevant example.

By contrast, the :foreign_key option for belongs_to specifies "the foreign key used for the association", but does not affect the name of the association. So, if I had

belongs_to :user, foreign_key: 'author_id'

the author's name of anArticle would be at anArticle.user.name. Not the same at all, and an invitation to disaster if I wish to add other User model references to an article (e.g., approved_by).

When I have my original, correct belongs_to declaration, anything in rails_admin that accesses my Article model throws an ActiveRecord::StatementInvalid exception in RailsAdmin::MainController#show, as shown in the attached exception report. rails_admin is simply ignoring the class_name specifier for the association.

I've read and reread the README and the wiki and have not seen any relevant information on the use of belongs_to with :class_name. This really is a showstopper for us; any help is greatly appreciated.

require 'yajl'
class Article < ActiveRecord::Base
belongs_to :author, class_name: 'User'
attr_accessible :content, :links, :status, :title, :title_image, :author
attr_accessible :links_text
# Validations and methods elided as irrelevant to the current issue.
end
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: helvetica, verdana, arial, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
white-space: pre-wrap;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>
<h1>
ActiveRecord::StatementInvalid
in RailsAdmin::MainController#show
</h1>
<pre>SQLite3::SQLException: no such column: articles.user_id: SELECT &quot;articles&quot;.* FROM &quot;articles&quot; WHERE &quot;articles&quot;.&quot;user_id&quot; = 2</pre>
<p><code>Rails.root: /Users/jeffdickey/src/rails/beta1</code></p>
<div id="traces">
<a href="#" onclick="document.getElementById(&#x27;Framework-Trace&#x27;).style.display=&#x27;none&#x27;;document.getElementById(&#x27;Full-Trace&#x27;).style.display=&#x27;none&#x27;;document.getElementById(&#x27;Application-Trace&#x27;).style.display=&#x27;block&#x27;;; return false;">Application Trace</a> |
<a href="#" onclick="document.getElementById(&#x27;Application-Trace&#x27;).style.display=&#x27;none&#x27;;document.getElementById(&#x27;Full-Trace&#x27;).style.display=&#x27;none&#x27;;document.getElementById(&#x27;Framework-Trace&#x27;).style.display=&#x27;block&#x27;;; return false;">Framework Trace</a> |
<a href="#" onclick="document.getElementById(&#x27;Application-Trace&#x27;).style.display=&#x27;none&#x27;;document.getElementById(&#x27;Framework-Trace&#x27;).style.display=&#x27;none&#x27;;document.getElementById(&#x27;Full-Trace&#x27;).style.display=&#x27;block&#x27;;; return false;">Full Trace</a>
<div id="Application-Trace" style="display: block;">
<pre><code></code></pre>
</div>
<div id="Framework-Trace" style="display: none;">
<pre><code>vendor/ruby/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize&#x27;
vendor/ruby/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `new&#x27;
vendor/ruby/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `prepare&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:246:in `block in exec_query&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log&#x27;
vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/notifications/instrumenter.rb:20:in `instrument&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:242:in `exec_query&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:467:in `select&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in `select_all&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/querying.rb:38:in `block in find_by_sql&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/explain.rb:40:in `logging_query_plan&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/querying.rb:37:in `find_by_sql&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:171:in `exec_queries&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:160:in `block in to_a&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/explain.rb:33:in `logging_query_plan&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:159:in `to_a&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation/finder_methods.rb:159:in `all&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_association.rb:382:in `find_target&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_association.rb:335:in `load_target&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_proxy.rb:44:in `load_target&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_proxy.rb:87:in `method_missing&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:112:in `set_pretty_method_name&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:34:in `initialize&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:10:in `new&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:10:in `block in from_exception&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:6:in `map&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:6:in `from_exception&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/error_page.rb:52:in `backtrace_frames&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:114:in `log_exception&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:87:in `rescue in protected_app_call&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:84:in `protected_app_call&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:79:in `better_errors_call&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:56:in `call&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call&#x27;
vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call&#x27;
vendor/ruby/1.9.1/gems/quiet_assets-1.0.2/lib/quiet_assets.rb:18:in `call_with_quiet_assets&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call&#x27;
vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:81:in `block in pre_process&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:79:in `catch&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:79:in `pre_process&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:54:in `process&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:39:in `receive_data&#x27;
vendor/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine&#x27;
vendor/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:159:in `start&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/thin.rb:13:in `run&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:268:in `start&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in &lt;top (required)&gt;&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `&lt;top (required)&gt;&#x27;
script/rails:6:in `require&#x27;
script/rails:6:in `&lt;main&gt;&#x27;</code></pre>
</div>
<div id="Full-Trace" style="display: none;">
<pre><code>vendor/ruby/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize&#x27;
vendor/ruby/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `new&#x27;
vendor/ruby/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `prepare&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:246:in `block in exec_query&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log&#x27;
vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/notifications/instrumenter.rb:20:in `instrument&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:242:in `exec_query&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/sqlite_adapter.rb:467:in `select&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in `select_all&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/querying.rb:38:in `block in find_by_sql&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/explain.rb:40:in `logging_query_plan&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/querying.rb:37:in `find_by_sql&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:171:in `exec_queries&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:160:in `block in to_a&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/explain.rb:33:in `logging_query_plan&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation.rb:159:in `to_a&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/relation/finder_methods.rb:159:in `all&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_association.rb:382:in `find_target&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_association.rb:335:in `load_target&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_proxy.rb:44:in `load_target&#x27;
vendor/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/associations/collection_proxy.rb:87:in `method_missing&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:112:in `set_pretty_method_name&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:34:in `initialize&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:10:in `new&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:10:in `block in from_exception&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:6:in `map&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/stack_frame.rb:6:in `from_exception&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/error_page.rb:52:in `backtrace_frames&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:114:in `log_exception&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:87:in `rescue in protected_app_call&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:84:in `protected_app_call&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:79:in `better_errors_call&#x27;
vendor/ruby/1.9.1/gems/better_errors-0.7.2/lib/better_errors/middleware.rb:56:in `call&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:32:in `call_app&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `block in call&#x27;
vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/tagged_logging.rb:22:in `tagged&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/logger.rb:16:in `call&#x27;
vendor/ruby/1.9.1/gems/quiet_assets-1.0.2/lib/quiet_assets.rb:18:in `call_with_quiet_assets&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/request_id.rb:22:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call&#x27;
vendor/ruby/1.9.1/gems/activesupport-3.2.12/lib/active_support/cache/strategy/local_cache.rb:72:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call&#x27;
vendor/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/static.rb:62:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:479:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/application.rb:223:in `call&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/content_length.rb:14:in `call&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/rack/log_tailer.rb:17:in `call&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:81:in `block in pre_process&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:79:in `catch&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:79:in `pre_process&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:54:in `process&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:39:in `receive_data&#x27;
vendor/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine&#x27;
vendor/ruby/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/backends/base.rb:63:in `start&#x27;
vendor/ruby/1.9.1/gems/thin-1.5.0/lib/thin/server.rb:159:in `start&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/handler/thin.rb:13:in `run&#x27;
vendor/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:268:in `start&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/server.rb:70:in `start&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:55:in `block in &lt;top (required)&gt;&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap&#x27;
vendor/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:50:in `&lt;top (required)&gt;&#x27;
script/rails:6:in `require&#x27;
script/rails:6:in `&lt;main&gt;&#x27;</code></pre>
</div>
</div>
<h2 style="margin-top: 30px">Request</h2>
<p><b>Parameters</b>: <pre>{&quot;model_name&quot;=&gt;&quot;user&quot;,
&quot;id&quot;=&gt;&quot;2&quot;}</pre></p>
<p><a href="#" onclick="document.getElementById('session_dump').style.display='block'; return false;">Show session dump</a></p>
<div id="session_dump" style="display:none"><pre>_csrf_token: &quot;nF/zaqwrtmgg8GmXGj7jHCk0aRtFZkfvxKeN6XASAcQ=&quot;
session_id: &quot;6242d07eaf3997af8ccf75a9228bf347&quot;
warden.user.user.key: [&quot;User&quot;, [1], &quot;$2a$10$SoCL1QSjR1EOf.hgl2wqhO&quot;]</pre></div>
<p><a href="#" onclick="document.getElementById('env_dump').style.display='block'; return false;">Show env dump</a></p>
<div id="env_dump" style="display:none"><pre>GATEWAY_INTERFACE: &quot;CGI/1.2&quot;
HTTP_ACCEPT: &quot;text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&quot;
HTTP_ACCEPT_CHARSET: &quot;ISO-8859-1,utf-8;q=0.7,*;q=0.3&quot;
HTTP_ACCEPT_ENCODING: &quot;gzip,deflate,sdch&quot;
HTTP_ACCEPT_LANGUAGE: &quot;en-GB,en-US;q=0.8,en;q=0.6&quot;
REMOTE_ADDR: &quot;127.0.0.1&quot;
SERVER_NAME: &quot;localhost&quot;
SERVER_PROTOCOL: &quot;HTTP/1.1&quot;</pre></div>
<h2 style="margin-top: 30px">Response</h2>
<p><b>Headers</b>: <pre>None</pre></p>
</body>
</html>
class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
has_many :articles
# Remaining validations elided as irrelevant to the current issue.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment