add alias tags #26

Merged
merged 1 commit into from Jul 27, 2012

Conversation

Projects
None yet
2 participants
Contributor

fntz commented Jul 18, 2012

Hi.

I made possibility to do aliases for tags.

For example.

 a = RocketTag::Tag.create(:name => 'rails')
 b = RocketTag::Tag.create(:name => 'ror')
 c = RocketTag::Tag.create(:name => 'ruby-on-rails')
 a.alias << [b, c]
 #now "rails" alias for "ror" and "ruby-on-rails"
 #and method "tagged_with" will return models not only with rails, but also ror and ruby-on-rails.  
 Model.tagged_with(["rails"])

Thanks.

Owner

bradphelan commented Jul 18, 2012

That is a nice idea. I'll check the code later. Thanks
On Jul 18, 2012 6:13 PM, "Mikhail C." <
reply@reply.github.com>
wrote:

Hi.

I made possibility to do aliases for tags.

For example.

 a = RocketTag::Tag.create(:name => 'rails')
 b = RocketTag::Tag.create(:name => 'ror')
 c = RocketTag::Tag.create(:name => 'ruby-on-rails')
 a.alias << [b, c]
 #now "rails" alias for "ror" and "ruby-on-rails"
 #and method "tagged_with" will return models not only with rails, but

also ror and ruby-on-rails.
Model.tagged_with(["rails"])

Thanks.

You can merge this Pull Request by running:

git pull https://github.com/fntzr/rocket_tag feature

Or you can view, comment on it, or merge it online at:

#26

-- Commit Summary --

  • add alias tags

-- File Changes --

M lib/generators/rocket_tag/migration/templates/active_record/migration.rb
(9)
M lib/rocket_tag.rb (2)
A lib/rocket_tag/alias_tag.rb (4)
M lib/rocket_tag/tag.rb (22)
M lib/rocket_tag/taggable.rb (20)
A spec/rocket_tag/tag_alias_spec.rb (75)
M spec/rocket_tag/taggable_spec.rb (6)
M spec/schema.rb (8)
M spec/spec_helper.rb (2)

-- Patch Links --

https://github.com/bradphelan/rocket_tag/pull/26.patch
https://github.com/bradphelan/rocket_tag/pull/26.diff


Reply to this email directly or view it on GitHub:
#26

Nice work and good testing :)

@bradphelan bradphelan added a commit that referenced this pull request Jul 27, 2012

@bradphelan bradphelan Merge pull request #26 from fntzr/feature
add alias tags
16461ca

@bradphelan bradphelan merged commit 16461ca into bradphelan:master Jul 27, 2012

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