On 15 August 2014 19:57, Turcu Marius <[email protected]> wrote:
> i have 2 models
> class User < ActiveRecord::Base
>   has_many :notes, :dependent => :destroy
>   accepts_nested_attributes_for :notes
>   devise :database_authenticatable, :registerable,
>          :recoverable, :rememberable, :trackable, :validatable
>
> end
>
>
> class Note < ActiveRecord::Base
>   belongs_to :user
>   validates :content, presence: true,length: { minimum: 15 }
>
> end
>
> the database schema
>
> create_table "notes", primary_key: "note_id", force: true do |t|

Why are you not using the default primary key (id)?  You will just
make life difficult if you avoid the rails conventions unless you have
a good reason for so doing.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtcUQDd9MPzHrf9zEcoyMpqEmfp1nQd3CdzLtNhJa%3DSWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to