Merge pull request #878 from basecamp/flavorjones/account-slug
Prefer Account#slug to Account.script_name
This commit is contained in:
@@ -3,10 +3,8 @@ class Account < ApplicationRecord
|
||||
|
||||
has_many_attached :uploads
|
||||
|
||||
class << self
|
||||
def script_name
|
||||
@script_name ||= "/#{sole.queenbee_id}"
|
||||
end
|
||||
def slug
|
||||
"/#{queenbee_id}"
|
||||
end
|
||||
|
||||
def setup_basic_template
|
||||
|
||||
@@ -29,7 +29,7 @@ module Card::Promptable
|
||||
* Collection id: #{collection_id}
|
||||
* Collection name: #{collection.name}
|
||||
* Number of comments: #{comments.count}
|
||||
* Path: #{collection_card_path(collection, self, script_name: Account.script_name)}
|
||||
* Path: #{collection_card_path(collection, self, script_name: Account.sole.slug)}
|
||||
|
||||
#{comments.last(MAX_COMMENTS).collect(&:to_prompt).join("\n")}
|
||||
END OF CARD #{id}
|
||||
|
||||
@@ -20,7 +20,7 @@ module Comment::Promptable
|
||||
* Card title: #{card.title}
|
||||
* Created by: #{creator.name}}
|
||||
* Created at: #{created_at}}
|
||||
* Path: #{collection_card_path(card.collection, card, anchor: ActionView::RecordIdentifier.dom_id(self), script_name: Account.script_name)}
|
||||
* Path: #{collection_card_path(card.collection, card, anchor: ActionView::RecordIdentifier.dom_id(self), script_name: Account.sole.slug)}
|
||||
END OF COMMENT #{id}
|
||||
PROMPT
|
||||
end
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
require "test_helper"
|
||||
|
||||
class AccountTest < ActiveSupport::TestCase
|
||||
test "slug" do
|
||||
account = Account.sole
|
||||
assert_equal "/#{account.queenbee_id}", account.slug
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user