Monday, January 14, 2013

[Rails] [Rails 3.2] How to extend a gem model

I am using the gem  'acts-as-taggable-on' ( mbleigh) and I need to extend the Tag model to  translate the tag name with Globalize
How can I add  "translates :name" into ActsAsTaggableOn::Tag ?  I can fork the gem and modify my version, but is there any way to do it simply with "extend ActiveSupport::Concern"  ?

currently :
module ActsAsTaggableOn
  class Tag < ::ActiveRecord::Base
    include ActsAsTaggableOn::Utils

    attr_accessible :name

needed :
module ActsAsTaggableOn
  class Tag < ::ActiveRecord::Base
    include ActsAsTaggableOn::Utils

    attr_accessible :name
translate :name

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Cc4mqmmxugwJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate