Skip to content

Commit

Permalink
your_default in helper.rb was broken. The only usage of it was
Browse files Browse the repository at this point in the history
unnecessary, so remove it.

[#986 state:resolved]
  • Loading branch information
bryanlarsen committed Dec 8, 2011
1 parent bc7478f commit a5db678
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions hobo/lib/hobo/helper.rb
Expand Up @@ -436,13 +436,6 @@ def this_field_help
this_parent.class.try.attribute_help(this_field.to_sym) || ""
end


# --- default Helpers --- #

def your_default
this == current_user ? "Your" : (this.name.ends_with?('s') ? "#{this.name}'" : "#{this.name}'s")
end

# --- Debugging Helpers ---- #

def abort_with(*args)
Expand Down
7 changes: 4 additions & 3 deletions hobo/lib/hobo/rapid/taglibs/rapid_core.dryml
Expand Up @@ -758,13 +758,14 @@ Notes

- `<your>Posts</your>`: "your Posts" or "Jim's Posts"
-->
<def tag="your" attrs="key, capitalize"><%=
<def tag="your" attrs="key, capitalize, name"><%=
key ||= 'default'
name ||= name(:no_wrapper => true)
# prepare symbolized attributes for merging
attrs = {}
attributes.each_pair{|k,v| attrs[k.to_sym] = v}
d = "#{your_default} #{all_parameters.default}"
options = {:default=>[d], :count=>(attrs[:count]||1), :name=>name(:no_wrapper => true)}
d = "#{name}'#{'s' unless name.ends_with?('s')} #{all_parameters.default}"
options = {:default=>[d], :count=>(attrs[:count]||1), :name=>name}
your_key = key.split('.').last
unless key.eql?(your_key) || attrs.has_key?(your_key.to_sym)
options[your_key.to_sym] = t(key, :count=>options[:count], :default=>your_key.titleize)
Expand Down

0 comments on commit a5db678

Please sign in to comment.