Skip to content

Commit

Permalink
Update: Classy Inheritance to current version 0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Stone committed Jun 25, 2008
1 parent 37e5ed5 commit 379b6b9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
== 0.5.11 2008-06-25
* Update: Classy Inheritance to current version 0.4.4

== 0.5.10 2008-06-24
* Modified: Classy Inheritance is now bundled with Lockdown to simplify the user management screens.
* Fixed: Templates: Use m.template with views to test for rails version for action_name issue
Expand Down
10 changes: 5 additions & 5 deletions lib/lockdown/classy-inheritance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def depends_on(model_sym, options = {})
define_can_be_method_on_requisite_class(model_sym, options[:as])
end

options[:attrs].each{|attr| define_accessors(model_sym, attr, options[:prefix])}
options[:attrs].each{|attr| define_accessors(model_sym, attr, options)}
end


Expand All @@ -65,7 +65,7 @@ def can_be(model_sym, options = {})

def define_relationship(model_sym, options)
opts = options.dup
opts.delete(:attrs)
[:attrs, :prefix].each{|key| opts.delete(key)}
if opts[:as]
as_opt = opts.delete(:as)
opts = polymorphic_constraints(as_opt).merge(opts)
Expand Down Expand Up @@ -115,8 +115,8 @@ def define_find_with_method(model_sym)
end
end

def define_accessors(model_sym, attr, prefix)
accessor_method_name = ( prefix ? "#{model_sym}_#{attr}" : attr)
def define_accessors(model_sym, attr, options)
accessor_method_name = ( options[:prefix] ? "#{model_sym}_#{attr}" : attr)

define_method accessor_method_name do
eval("self.#{model_sym} ? self.#{model_sym}.#{attr} : nil")
Expand All @@ -126,7 +126,7 @@ def define_accessors(model_sym, attr, prefix)
model_defined = eval("self.#{model_sym}")

unless model_defined
klass = model_sym.to_s.classify
klass = options[:class_name] || model_sym.to_s.classify
eval("self.#{model_sym} = #{klass}.new")
end

Expand Down
2 changes: 1 addition & 1 deletion lib/lockdown/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Lockdown #:nodoc:
module VERSION #:nodoc:
MAJOR = 0
MINOR = 5
TINY = 10
TINY = 11

STRING = [MAJOR, MINOR, TINY].join('.')
end
Expand Down
2 changes: 1 addition & 1 deletion website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<h1>Lockdown</h1>
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/lockdown"; return false'>
<p>Get Version</p>
<a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.10</a>
<a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.11</a>
</div>
<h2>What</h2>

Expand Down

0 comments on commit 379b6b9

Please sign in to comment.