Method: Facebooker::Rails::Publisher::FacebookTemplate.find_in_db

Defined in:
lib/facebooker/rails/publisher.rb

.find_in_db(klass, method) ⇒ Object



156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/facebooker/rails/publisher.rb', line 156

def find_in_db(klass,method)
  template = find_by_template_name(template_name(klass,method))
  if template and template.template_changed?(hashed_content(klass,method))
    template.destroy
    template = nil
  end
  
  if template.nil?
    template = register(klass,method)
  end
  template
end