Something that gets on my nerves about Gay society today would be the political alliance a member of the LGBT community makes to the Democratic party. I myself once felt this was the party which best served the interest of the LGBT community and instinctively felt it would be within my own self interest to vote for the candidate running under the Democratic ticket. This was a foolish oversight on my part simply because there doesn’t seem to be any interest thus far from the Democratic party supporting the rights of LGBT people.

I know some people who are reading this already fired up and are hitting up Google to find literature that supports otherwise. Just wait a second before you get upset because there is a point to all of this.

I felt compelled to right this because recently the Huffington Post syndicated an article from Towleroad which was about the owners of Manhunt making a donation to the McCain campaign. Even though the donation was made in March 2008 for whatever reason it recently caught the attention of these media outlets. At least the only two (which I know) which feel it is news their readers might find interesting.

Reading the comments people had about the article on Towleroad sounded a little familiar to me. They seemed to sum up exactly how I would have felt about the donation to a campaign which holds little if any tolerance for the rights of LGBT people made by the owners of a Gay sex site no less! Ignorance is most certainly bliss and hindsight is a most fortunate luxury.

The article captions an image which reflects one of the owners of Manhunt responding to a comment left on another blogs article where they were called a liberal which was evidently offensive to the owner(s) of Manhunt. The comment continues to justify the donation by insisting that matters of National security were important and one could worry about gay agenda later.

What the response fails to recognize is this “gay agenda” is only another example how our government denies us our right to due process and fails to validate our civil liberties. Gay marriage is a civil right and if anyone is against whether they be straight or gay would be allowing our government to limit there own civil liberties.

This limit on our civil liberties is further supported by Obama’s campaign which really doesn’t do anything other than dangle a carrot in the face of the LGBT voters by supporting Civil Unions. They had to keep the dedicated members of the Gay community happy because there after all this social obligation every LGBT member has to vote for the Democrat. This is why off-brand products and designer impostor merchandise make their way to the shelves because people are happy just with the label and not necessarily with the real thing. I suppose that buying a pile of fertilizer to live wouldn’t be so bad as long as the person who sold it to me called it a piece of prime real estate and more importantly if the deed to said property identified it as something to the like.

TJ Maxx and Marshall’s entire business model is based around buying liquidated designer clothing then selling to customers who generally feel satisfied they found a good deal on this name brand merchandise even though the tag might be torn off or marked through. Everyone knows it came from Gucci so who cares where it came from despite the fact it was bought and resold with the understanding the said items was damaged or flawed. Better yet those people who sell those named brand bags on the street keep showing up and selling knock off purses because some fool feels happy to buy something that just has a designer label on it. Even though it is evident to all parties involved in the transaction they are buying bologna.  To everyone else it looks real or at least that’s what the tag says so we have no other choice but to manifest this entire facade into our own realities.

Some people feel calling Civil Unions between Gay people protects to sanctity of Marriage. I guess this would be a valid argument should Mary and Joseph have gone down to Jerusalem City Hall to receive a marriage license before any formal ceremony. I have to wonder were there any vigilantes to protect the sanctity of marriage when we stopped looking for the blessing from our church and started looking for a piece of paper which contained the names of two locals and secured a home for it in an official government filing cabinet. There seems to be this lack of documentation about exactly how the conversion took place. I would be curious to know if the government would “grandfather” any existing marriages which existed prior to having established the requirement for public record. It is worth noting there had been Sixteen Centuries of marriages before the need for any such public record required for marriage to actually exist. This argument as you can see isn’t much of one but people but I guess they like giving the government limit our civil liberties. More than likely violation of their civil liberties hasn’t hit home yet. Maybe if it ever got to the point that we would have to get permission from our government so a family would be allowed to legally move to another state they might get the point then that we should have stopped letting our rights be taken away from us.

Nobody suggested that allowing everyone to sit at the front of the bus would be OK as long as to some weren’t allowed to mentally recognize that they were actually sitting at the front of the bus even though they could sit where the please.

The Libertarian party has embraced same sex marriages since the 1970s and no fancy word alternative to pacify those who might not want to give liberties to others. Bob Barr is the candidate for the Libertarian party. So those who feel that voting for the Democratic party is what you should do simply because you are a member for the LGBT community wake up because they still would like to keep limiting your rights. They just want to make sure they get your vote even though it gives an impression of being inadequate of a title reserved for more traditional marriages. Don’t let other people make your mind up for you.

This started with the help of this Rails Messaging Tutorial which I borrowed a used a couple lines of code from this tutorial to extend this project. So many thanks to manitoba98 and the guys at PingMe for writing acts_as_network.

There are so many things acts_as_network can be used for. So far I have used acts_as_network to allow users to be able to invite friends as well as receive friend requests from other members. It was also used to implement a way for users to block other users and I am using it for my messaging system. So I thought I would put this out there just to kind of show anyone who might be interested to see just how great acts_as_network is.

So I will assume you have installed the plugin. Follow the link above if you cannot find it otherwise. I am also using restful_authentication but you can use whatever.

After you install the plugin create a new model and controller

script/generate model Mail user_id:integer user_id_target:integer subject:string body:text recipient_deleted:boolean author_deleted:boolean

script/generate controller Messages index show new edit

In the migration setup

t.boolean :author_deleted, :default => ‘false’

t.boolean :recipient_deleted, :default => ‘false’

Now in your User Model add the association

class User < ActiveRecord::Base

   acts_as_network :messages, :through => :mails,

end

Now in the Mail Model

class Mail < ActiveRecord::Base
  belongs_to  :user
  belongs_to  :user_target, :class_name => ‘User’, :foreign_key => ‘user_id_target’
  validates_presence_of :user, :user_target, :body

Setup your Controller to look something like this…

class MessagesController < ApplicationController
  before_filter :login_required

  def index
    @messages = (params[:folder] != ’sent’) ? current_user.mails_in : current_user.mails_out
    @folder = params[:folder]
  end
  def show
    @message = Mail.find(params[:id])
    @user = User.find(@message.user_id)
  end

  def new
    @message = Mail.new
    @target = User.find(params[:user_target])
  end
  def edit
    @message = Mail.find(params[:id])
    @subject = @message.subject.sub(/^(Re: )?/, “Re: “)
    @target = User.find(@message.user_id)
  end
  def create
    @message = Mail.new(:user => current_user, :user_target => User.find(params[:user_target]), :subject => params[:subject], :body => params[:body])
    @message.save ? redirect_to(inbox_path) : render(:action => ‘new’, :user_targer => params[:user_target])   
  end
  def update
    @message = Mail.find(params[:id])
    @message.toggle!(:recipient_deleted) ? redirect_to(inbox_path) : redirect_to(:action => ’show’, :id => params[:id])
  end
  def destroy
    @message = Mail.find(params[:id])
    if @message.user_id == current_user.id
      @message.update_attribute(”author_deleted”, true)
    elsif @message.user_id_target == current_user.id
      @message.update_attribute(”recipient_deleted”, true)     
    elsif @message.user_id == current_user.id && @message.user_id_target == current_user.id
      @message.update_attributes(”recipient_deleted” => true, “author_deleted” => true)
    end
    redirect_to inbox_path
  end

end

The index.html.erb I am about to show you is for an example only. It’s wasn’t written with DRY in mind. I’ll post some better looking code at some later point but for now this is what it is.

<table width=”100%” border=”0″>
    <tr>
        <th>Login</th>
        <th>Subject</th>
        <th>Sent</th>
    </tr>
        <% @messages.each do |message| %>
            <% user = (@folder != ’sent’)? User.find(message.user_id) : User.find(message.user_id_target) %>
            <% if @folder == ‘inbox’ || @folder.blank? %>
                <% if message.recipient_deleted == false %>
                    <tr>
                        <td><%= link_to user.login, user_path(user) %></td>
                        <td><%= link_to message.subject, message_path(message) %></td>
                        <td><%= distance_of_time_in_words(message.created_at, Time.now) %> ago</td>
                    </tr>
                <% end %>
            <% elsif @folder == ’sent’ %>
                <% if message.author_deleted == false %>
                    <tr>
                        <td><%= link_to user.login, user_path(user) %></td>
                        <td><%= link_to message.subject, message_path(message) %></td>
                        <td><%= distance_of_time_in_words(message.created_at, Time.now) %> ago</td>
                    </tr>
                <% end %>
            <% elsif @folder == ‘trash’ %>
                <% if message.recipient_deleted == true %>
                    <tr>
                        <td><%= link_to user.login, user_path(user) %></td>
                        <td><%= link_to message.subject, message_path(message) %></td>
                        <td><%= distance_of_time_in_words(message.created_at, Time.now) %> ago</td>
                    </tr>
                <% end %>               
            <% end %>
        <% end %>
</table>
</div>

edit.html.erb

<% form_tag ‘/messages/create’ do %>
    <ul>
        <li><label for=”user_target”>To:</label> <%=h @target.login %><%= hidden_field_tag ‘user_target’, @target.id %></li>
        <li><label for=”subject”>Subject:</label> <%= text_field_tag ’subject’, @subject %></li>
        <li><label for=”body”>Body:</label><br /> <%= text_area_tag ‘body’, @body %></li>
        <li><%= submit_tag ‘Create’ %></li>
    </ul>
<% end %>

new.html.erb

<div id=”message_new”>
<% form_tag ‘/messages/create’ do %>
    <ul>
        <li><label for=”user_target”>To:</label> <%=h @target.login %><%= hidden_field_tag ‘user_target’, @target.id %></li>
        <li><label for=”subject”>Subject:</label> <%= text_field_tag ’subject’, ” ,:class=>”text”  %></li>
        <li><label for=”body”>Body:</label><br /> <%= text_area_tag ‘body’ %></li>
        <li><%= submit_tag ‘Create’ %></li>
    </ul>
<% end %>
</div>

show.html.erb

<div id=”message_show”>
    <ul>
        <li>Subject: <%=h @message.subject %></li>
        <li>From: <%=h @user.login %></li>
        <li class=”body”>Body:<br /><br /><%= @message.body %></li>
        <li><%= link_to ‘Reply’, edit_message_path %> | <%= link_to ‘Trash’, message_path(@message), :method => :delete %></li>
    </ul>
</div>

routes.rb:     map.resources :messages

                   map.inbox ‘/inbox’, :controller => ‘messages’, :action => ‘index’, :folder => ‘inbox’

                  map.sent  ‘/sent’, :controller => ‘messages’, :action => ‘index’, :folder => ’sent’

And that should about do it.

 

The project I am working on pretty much revolves around a user’s profile. I am still pretty new to working with Rails but, I knew there was an easier way of implementing this without having to add columns to the user table. I looked around for awhile for a tutorial or blog suggesting a painless way of adding this to an application.
I really wasn’t able to find anything so I decided to write this mini-how to.

I would first recommend that you take a look at Raaum’s Rails Reader. There is some really great documentation about ActiveRecord and how associations work. It would behoove you to follow along creating the user models and the migrations following along with the text because things will make sense that way. If you are lazy like me creating a bunch of junk models that you are just going to destroy sounds tedious I know but, it’s definitely worth the effort in the long run.

Nevertheless, I needed to be able to call a user’s profile within current_user. For example current_user.profile.body. So assuming you have already created your user model and setup the inclusion within you Application Controller. Now create your profile model and the migration accordingly.

script/generate model Profile user_id:integer body:text

Now open the Profile controller and add has_one :user somewhere after the class declaration.

class Profile < ActiveRecord::Base
has_one :user
end

It is work mentioning at this point that within the scope of this text the user will be created then redirected to the edit their profile. So if you plan to add validations in your model (ie: validates_presence_of) make sure to include

validates_presence_of :your_fields, :on => :update

Otherwise you will be unable to save the profile later.
Now add the same has_one statement to your User model but you will use

class User < ActiveRecord::Base
has_one :profile

Here is an example of how your controller might look…

class UsersController < ApplicationController
after_filter :update_session, :only => :create
before_filter :login_required, :only => [:edit, :show, :update]
before_filter :logout_required, :only => [:new, :create]
def index
@users = User.find(:all, :conditions => ['status = ?', 'active'])
end
def show
@user = User.find_by_login(params[:id])
end
def create
@user = User.new(params[:user])
@user.profile = Profile.new
self.current_user = (@user.save!)? @user : render(:action => ‘new’)
redirect_to :action => ‘edit’, :id => self.current_user.login
flash[:notice] = ‘Account successfully created!’
end
def update
self.current_user.profile.update_attributes!(params[:profile])? redirect_to(:action => ’show’, :id => self.current_user.login) : render(:action => ‘edit’)
end
end

As you can see when the create method is called it creates the Profile model and after the user is saved then redirected to the edit template.

This was the solution that worked best for me.

This fun street parade woke me up this morning.

Tags:

Cops: Florida Boy, 13, Killed Brother, 8, Over Dessert:
ORLANDO, Fla. — A 13-year-old choked and beat his 8-year-old brother to death because the younger boy ate a dessert and the older one worried he would be blamed, authorities said Wednesday.
Demetrius Key was arrested on first-degree murder. The boys’ mother, Tangela Key, told police she was visiting a cousin nearby and left him in charge of Levares Key and other younger siblings Saturday.
A neighbor told investigators she heard four loud bangs, followed by 10 minutes of quiet and then more commotion, according to an Orange County Sheriff’s Office news release.
Demetrius Key went to the cousin’s house and told his mother his brother was “passed out,” the sheriff’s office said. The younger boy was pronounced dead at a hospital.
Demetrius Key initially said he hit his brother with a metal shelf support, investigators said. After investigators searched the house, he said he used a broom handle, the sheriff’s office said.
He then told the detective he punched the boy, choked him and banged his head on the floor, according to an affidavit.
“Demetrius offered that Levares upset him by eating a dessert that (he) was not to have eaten,” Detective Appling Wells wrote. “He also advised Levares upset him by picking a scab and causing it to bleed.
“Demetrius said he feared Levares would blame both circumstances on him and tell his mother he had struck him and eaten the dessert.”
The sheriff’s office would not say what the dessert was.

Tags:

NYTimes.com:

“We’re cutting off many heads,” Steve Robertson, a special agent and spokesman for the D.E.A., said yesterday.

“Will new heads grow back? Yeah. That’s the nature of the drug business.”

I guess it’s just another game of Whack-a-Mole to these guys.

Tags:

To Whom It May Concern:

We have received your request for additional documentation to remove any restricted access which has been placed on our account. Your request was carefully considered. However, we regret we are unable to submit copies of invoices from our supplier(s) without first having a Nondisclosure Agreement from your firm.

Additionally, the privacy of our customers, suppliers, and any third parties, which we might conduct business, is very important to us. We are currently reviewing any Privacy or Confidentiality Agreement we have with our supplier(s) to make sure there is not a breach of contract providing this information to your firm.

With your cooperation of providing us with a Nondisclosure Agreement we will provide the requested documentation. Otherwise we would regrettably have to request our account be formally closed and the remaining balance be returned. You may deduct any monies owed to Ebay, Inc. providing an invoice is submitted along with your instrument.

Thank you for your efforts in resolving this matter.

Sincerely,

Nathan Wilson