<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).

# Load default admin user
if Rails.env != "production"
  User.create(:username => "voldemort", :email => "<EMAIL>", :password => "<PASSWORD>", :password_confirmation => "<PASSWORD>") if User.count == 0
end

# Load default groups
usage = Group.find_or_create_by_name(:name => "Article Usage")
citations = Group.find_or_create_by_name(:name => "Citations")
social_networks = Group.find_or_create_by_name(:name => "Social Networks")
blogs_media = Group.find_or_create_by_name(:name => "Blogs and Media Coverage")

# Load default sources
citeulike = Citeulike.find_or_create_by_name(  
	:name => "citeulike", 
	:display_name => "CiteULike", 
  :description => "CiteULike is a free social bookmarking service for scholarly content.",
	:active => true, 
	:workers => 1,
	:group_id => social_networks.id,
	:url => "http://www.citeulike.org/api/posts/for/doi/%{doi}" )
pubmed = PubMed.find_or_create_by_name(  
  :name => "pubmed", 
  :display_name => "PubMed", 
  :description => "PubMed Central is a free full-text archive of biomedical literature at the National Library of Medicine.",
  :active => true, 
  :workers => 1,
  :group_id => citations.id,
  :url => "http://www.pubmedcentral.nih.gov/utils/entrez2pmcciting.cgi?view=xml&id=%{pub_med}")
scienceseeker = ScienceSeeker.find_or_create_by_name(  
	:name => "scienceseeker", 
	:display_name => "ScienceSeeker", 
  :description => "Research Blogging is a science blog aggregator.",
	:active => true, <commit_msg>ALM-236 added logic to seed relative metric source<commit_after># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).

# Load default admin user
if Rails.env != "production"
  User.create(:username => "voldemort", :email => "<EMAIL>", :password => "<PASSWORD>", :password_confirmation => "<PASSWORD>") if User.count == 0
end

# Load default groups
usage = Group.find_or_create_by_name(:name => "Article Usage")
citations = Group.find_or_create_by_name(:name => "Citations")
social_networks = Group.find_or_create_by_name(:name => "Social Networks")
blogs_media = Group.find_or_create_by_name(:name => "Blogs and Media Coverage")
testing = Group.find_or_create_by_name(:name => "Testing")

# Load default sources
citeulike = Citeulike.find_or_create_by_name(  
	:name => "citeulike", 
	:display_name => "CiteULike", 
  :description => "CiteULike is a free social bookmarking service for scholarly content.",
	:active => true, 
	:workers => 1,
	:group_id => social_networks.id,
	:url => "http://www.citeulike.org/api/posts/for/doi/%{doi}" )
pubmed = PubMed.find_or_create_by_name(  
  :name => "pubmed", 
  :display_name => "PubMed", 
  :description => "PubMed Central is a free full-text archive of biomedical literature at the National Library of Medicine.",
  :active => true, 
  :workers => 1,
  :group_id => citations.id,
  :url => "http://www.pubmedcentral.nih.gov/utils/entrez2pmcciting.cgi?view=xml&id=%{pub_med}")
relativemetric = RelativeMetric.find_or_create_by_name(
  :name => "relativemetric",
  :display_name => "Relative Metric",
  :description => "Relative metric gives context to the raw numbers that are collected.",
  :active => true,
  :workers => 1,
  :group_id => testing.id,
  :url => "http://rwc-couch01.int.plos.org:5984/relative_metrics/_design/relative_metric/_view/average_usage?key=%{key}",
  :solr_url => "http://api.plos.org/search")
scienceseeker = ScienceSeeker.find_or_create_by_name(  
	:name => "scienceseeker", 
	:display_name => "ScienceSeeker", 
  :description => "Research Blogging is a science blog aggregator.",
	:active => true, 
{'fraction_non_alphanumeric': 0.13779830638953042, 'fraction_numerical': 0.004618937644341801, 'mean_word_length': 5.207006369426751, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 70, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '703126', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1256, 'n_words': 337}