It seems I am missing the magic of ruby on rails 4.
I wanted to create an object which includes ActiveModel::Model
but which class name contains two words.
Therefore I created app/models/registration_form.rb
with the following code:
class RegistrationForm
include ActiveModel::Model
attr_accessor(:email)
validates :email, presence: true
end
When the object is created within the controller by using RegistrationForm.new
the following error occurs:
Could not find table 'registration_forms'
When I just delete the postfix Form
and rename the file to app/models/registration.rb
everthing works fine.
When the code from above is executed within rails console
everything works fine, too.
The stacktrace of the error shows that ActiveRecord is called: https://gist.github.com/anonymous/273986937cd774b5953c