acts_as_arter_flow_object 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_arter_flow_object}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tim.teng"]
12
- s.date = %q{2010-04-16}
12
+ s.date = %q{2010-04-19}
13
13
  s.description = %q{simple progress indicator for game arters }
14
14
  s.email = %q{tim.rubist@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -9,6 +9,7 @@ class ActsAsArterFlowObjectGenerator < Rails::Generator::Base
9
9
  m.migration_template 'migration.rb', 'db/migrate',
10
10
  :assigns => { :migration_name => "CreateArterFlowObjectsTable" },
11
11
  :migration_file_name => "create_arter_flow_objects_table"
12
+ m.route_resources :arter_flow_objects
12
13
  end
13
14
  end
14
15
 
@@ -9,7 +9,6 @@ module ActsAsAFO
9
9
  def acts_as_arter_flow_object
10
10
  has_one :arter_flow_object, :as => :afoable, :dependent => :destroy
11
11
  include InstanceMethods
12
-
13
12
  end
14
13
 
15
14
  end
@@ -1,5 +1,7 @@
1
1
  class ArterFlowObject < ActiveRecord::Base
2
2
 
3
+ default_scope :order => "created_at desc"
4
+
3
5
  belongs_to :afoable, :polymorphic => true
4
6
 
5
7
  STEPS = [:design, :model, :map, :rig]
@@ -10,4 +12,8 @@ class ArterFlowObject < ActiveRecord::Base
10
12
  EOF
11
13
  end
12
14
 
15
+ def self.afo_types_for_select
16
+ find(:all, :select => "DISTINCT afoable_type").inject([]){|ary,rcd| tipe = rcd.call(:afoable_type); ary << [Kernel.const_get(tipe).human_name,tipe]}
17
+ end
18
+
13
19
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 0.1.0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - tim.teng
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-16 00:00:00 +08:00
17
+ date: 2010-04-19 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies: []
20
20