Slugging breaks through a has_many #284

matthewrudy opened this Issue May 15, 2012 · 3 comments


None yet
2 participants

I have the following setup

class User
  has_many :items

class Item
  belongs_to :user

  extend FriendlyId
  friendly_id :name, :use => :slugged

Everything works find working with an Item directly, but when its created through user.items things go wrong => "Some Name", :user_id => 1).save!
# works => "Some Name").save!
# doesnt set the slug, and breaks on NOT NULL constraint

Further interrogation reveals # works
# NoMethodError: undefined method `set_slug' for #<Item:0x007fefd94cd0d0>

Update: I tried adding a test to the project [] and it works.

I guess this is some subtle thing to do with rails development mode.


xymbol commented Dec 8, 2012

@matthewrudy Can you confirm this issue is still valid? I couldn't find your test code.

i think this was an obscure one off issue.
so let's just close it.

matthewrudy closed this Dec 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment