Module: Writefully::Postable::ClassMethods

Defined in:
lib/writefully/postable.rb

Instance Method Summary collapse

Instance Method Details

#wf_content(field_name) ⇒ Object



50
51
52
53
54
# File 'lib/writefully/postable.rb', line 50

def wf_content(field_name)
  class_eval do 
    alias_attribute :content, :"#{field_name}" unless field_name == :content
  end
end

#wf_taxonomize(type, *args) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/writefully/postable.rb', line 40

def wf_taxonomize(type, *args)
  class_eval do 
    has_many :"#{type}", *args

    define_method("#{type}=") do |tokens|
      self.taxonomize_with(tokens, type)
    end
  end
end