Skip to content

Instantly share code, notes, and snippets.

@ddellacosta
Created November 22, 2010 21:01
Show Gist options
  • Save ddellacosta/710670 to your computer and use it in GitHub Desktop.
Save ddellacosta/710670 to your computer and use it in GitHub Desktop.
acts_as_taggable_on saving from parent relation
irb(main):094:0> @dfd.is_a?(User)
=> true
irb(main):095:0> @dfd.is_tagger?
=> true
irb(main):096:0> @alink = { :name => 'google', :link => 'http://google.com', :description => '', :tag_list => 'hello' }
=> {:name=>"google", :link=>"http://google.com", :description=>"", :tag_list=>"hello"}
irb(main):097:0> new_link = @dfd.links.new(@alink)
=> #<Link id: nil, name: "google", description: "", link: "http://google.com", created_at: nil, updated_at: nil, user_id: 1>
irb(main):098:0> new_link.tag_list
=> []
irb(main):099:0> new_link.is_taggable?
=> true
irb(main):100:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment