Permalink
Browse files

More descriptive method and attribute names

  • Loading branch information...
1 parent 5ada55f commit 7fd75a7f3a36302809070faaef8cd4f4fb3ddb2b @rjsamson rjsamson committed Sep 20, 2012
Showing with 7 additions and 7 deletions.
  1. +2 −2 app/models/tag.rb
  2. +1 −1 app/views/stories/_form.html.erb
  3. +3 −3 db/migrate/20120919195401_private_tags.rb
  4. +1 −1 db/schema.rb
View
@@ -6,11 +6,11 @@ class Tag < ActiveRecord::Base
if user.is_admin?
all
else
- where(:private => false)
+ where(:privileged => false)
end
end
- def self.all_with_filtered_counts(user)
+ def self.all_with_filtered_counts_for(user)
counts = TagFilter.count(:group => "tag_id")
Tag.order(:tag).accessible_to(user).map{|t|
@@ -24,7 +24,7 @@
<%= f.label :tags_a, "Tags:", :class => "required",
:style => "line-height: 2.3em;" %>
<%= f.select "tags_a", options_for_select(
- Tag.all_with_filtered_counts(@user).map{|t|
+ Tag.all_with_filtered_counts_for(@user).map{|t|
[ "#{t.tag} - #{t.description}", t.tag, { "data-html" => raw("<strong>") +
t.tag + raw("</strong> - ") + t.description.to_s +
(t.filtered_count == 0 ? "" :
@@ -1,15 +1,15 @@
class PrivateTags < ActiveRecord::Migration
def up
- add_column :tags, :private, :boolean, :default => false
+ add_column :tags, :privileged, :boolean, :default => false
# All existing tags should be public by default
Tag.all.each do |t|
- t.private = false
+ t.privileged = false
t.save
end
end
def down
- remove_column :tags, :private
+ remove_column :tags, :privileged
end
end
View
@@ -115,7 +115,7 @@
t.string "tag", :limit => 25, :default => "", :null => false
t.string "description", :limit => 100
t.boolean "filtered_by_default", :default => false
- t.boolean "private", :default => false
+ t.boolean "privileged", :default => false
end
add_index "tags", ["tag"], :name => "tag", :unique => true

0 comments on commit 7fd75a7

Please sign in to comment.