annotate .svn/pristine/32/328e5d644f9c7f34ce3b37165d648bfc6611fce5.svn-base @ 1051:ef882e222003 bibplugin_bibtex

Changing the way the bibtex is parsed: uses link_to_remote instead of remote_form_for; using RJS; created tab helper (still not implemented correctly in terms of views
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 16 Nov 2012 19:05:01 +0000
parents cbb26bc654de
children
rev   line source
Chris@909 1 class AddCustomFieldsPosition < ActiveRecord::Migration
Chris@909 2 def self.up
Chris@909 3 add_column(:custom_fields, :position, :integer, :default => 1)
Chris@909 4 CustomField.find(:all).group_by(&:type).each do |t, fields|
Chris@909 5 fields.each_with_index do |field, i|
Chris@909 6 # do not call model callbacks
Chris@909 7 CustomField.update_all "position = #{i+1}", {:id => field.id}
Chris@909 8 end
Chris@909 9 end
Chris@909 10 end
Chris@909 11
Chris@909 12 def self.down
Chris@909 13 remove_column :custom_fields, :position
Chris@909 14 end
Chris@909 15 end