logicgraph.rake revision c9787343e27ef9fcd9eed2e0aa3dd3ef8fe56bcd
namespace :logicgraph do
def save(entity)
entity.user = @user if entity.has_attribute? "user_id"
begin
rescue ActiveRecord::RecordInvalid => e
end
end
task :import => :environment do
@user = User.find_all_by_admin(true).first
@user = User.find_by_email! ENV['EMAIL'] unless ENV['EMAIL'].nil?
logic: Proc.new{ |h| save(h) },
language: Proc.new{ |h| save(h) },
logic_mapping: Proc.new{ |h| save(h) },
support: Proc.new{ |h| save(h) }
end
end