Skip to content

Commit

Permalink
Merge pull request #56 from gringocl/master
Browse files Browse the repository at this point in the history
Change Users to Admins and Dudes to Members. closes #2
  • Loading branch information
zenspider committed Apr 17, 2014
2 parents b2e6a7d + 2cf40e6 commit 801f513
Show file tree
Hide file tree
Showing 53 changed files with 400 additions and 1,007 deletions.
6 changes: 3 additions & 3 deletions Rakefile
Expand Up @@ -15,7 +15,7 @@ task :update_gems => :environment do

users = {}

Dude.find(:all).map(&:ruby_gems_id).sort.each do |user|
Member.find(:all).map(&:ruby_gems_id).sort.each do |user|
warn "Fetching #{user}"
json = URI.parse("http://rubygems.org/api/v1/owners/#{user}/gems.json").read
gems = JSON.parse json
Expand All @@ -35,7 +35,7 @@ task :update_gems => :environment do
usernames = users.keys.sort
gemnames = rubygems.keys.sort
known_projects = Hash[Project.all.map { |p| [p.name, p] }]
known_users = Hash[Dude.all.map { |u| [u.ruby_gems_id, u] }]
known_users = Hash[Member.all.map { |u| [u.ruby_gems_id, u] }]

add = (gemnames - known_projects.keys)
del = (known_projects.keys - gemnames)
Expand Down Expand Up @@ -68,7 +68,7 @@ task :update_gems => :environment do

users.each do |user|
warn " Adding user #{user}"
proj.dudes << known_users[user]
proj.members << known_users[user]
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/about_controller.rb
Expand Up @@ -4,7 +4,7 @@ def index
end

def people
@people = Dude.order('featured desc, name asc')
@people = Member.order('featured desc, name asc')
end

def projects
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/talks_controller.rb
Expand Up @@ -10,11 +10,11 @@ def index
def create
#spam catch to redirect - maybe the bots were ignoring the spam field
redirect_to talks_url and return if talk_params[:special_talk_requests].present?

@talk = Talk.new talk_params

if @talk.save
admins = User.find_all_by_talk_notification(true).map(&:email)
admins = Admin.find_all_by_talk_notification(true).map(&:email)
AdminMailer.admin_notification(admins,@talk).deliver unless admins.empty?
redirect_to talks_url, notice: 'Talk was successfully created.'
else
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb → app/models/admin.rb
@@ -1,4 +1,4 @@
class User < ActiveRecord::Base
class Admin < ActiveRecord::Base
devise(:database_authenticatable,
:recoverable,
# :confirmable, # TODO: figure out email on heroku
Expand Down
2 changes: 1 addition & 1 deletion app/models/affiliation.rb
@@ -1,4 +1,4 @@
class Affiliation < ActiveRecord::Base
belongs_to :dude
belongs_to :member
belongs_to :project
end
2 changes: 1 addition & 1 deletion app/models/dude.rb → app/models/member.rb
@@ -1,4 +1,4 @@
class Dude < ActiveRecord::Base
class Member < ActiveRecord::Base
habtm :projects, :join_table => :affiliations

validates_presence_of :name
Expand Down
2 changes: 1 addition & 1 deletion app/models/project.rb
@@ -1,5 +1,5 @@
class Project < ActiveRecord::Base
habtm :dudes, :join_table => :affiliations
habtm :members, :join_table => :affiliations

validates_presence_of :name
end
6 changes: 3 additions & 3 deletions app/views/about/projects.html.erb
@@ -1,5 +1,5 @@
<p class="lead">
<%= @projects.size %> projects from just <%= Dude.count %> people...
<%= @projects.size %> projects from just <%= Member.count %> people...
<%= ["Not bad!", "How prolific!", "I've seen better..."].sample %>
</p>

Expand All @@ -10,8 +10,8 @@
<%= project.description %>
<h3>Authors</h3>
<ul class='links'>
<% project.dudes.each do |dude| %>
<li><%= link_to dude.name, "/people##{dude.name.parameterize}" %></li>
<% project.members.each do |member| %>
<li><%= link_to member.name, "/people##{member.name.parameterize}" %></li>
<% end %>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/rails_admin.rb
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

RailsAdmin.config do |config|
config.current_user_method { current_user }
config.current_user_method { current_admin }

config.main_app_name = ['Seattle.rb', 'Admin']
end
2 changes: 1 addition & 1 deletion config/routes.rb
Expand Up @@ -5,7 +5,7 @@

mount RailsAdmin::Engine => '/adminsrb', :as => 'rails_admin'

devise_for :users
devise_for :admins

get "talks/checklist" => "talks#checklist"

Expand Down
34 changes: 0 additions & 34 deletions db/migrate/20081106022910_poopulate_dudes.rb

This file was deleted.

155 changes: 0 additions & 155 deletions db/migrate/20081106024445_poopulate_projects.rb

This file was deleted.

181 changes: 0 additions & 181 deletions db/migrate/20081106074841_poopulate_affiliations.rb

This file was deleted.

0 comments on commit 801f513

Please sign in to comment.