aiwilliams-dataset 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,8 +1,12 @@
1
+ *1.3.0 [Rails 2.3.2] (??)
2
+
3
+ * Supporting Rails 2.3.2 [mhawkins, underlog]
4
+
1
5
  *1.2.0 [Cucumber] (April 8, 2009)
2
6
 
3
7
  * Support for cucumber [jgarber, seancribbs]
4
8
 
5
-
9
+
6
10
  *1.1.0 [STI, belongs_to] (February 14, 2009)
7
11
 
8
12
  * STI is better supported for inserting, naming and finding records [aiwilliams]
@@ -48,7 +52,7 @@
48
52
  create_person(:name => 'Little John')
49
53
  people(:little_john)
50
54
 
51
-
55
+
52
56
  *1.0.0 [Scenarios Replacement] (December 15, 2008)
53
57
 
54
58
  * Drop-in replacement for Scenarios plugin of old [aiwilliams]
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :minor: 2
2
+ :minor: 3
3
3
  :patch: 0
4
4
  :major: 1
@@ -36,23 +36,31 @@ module Dataset
36
36
 
37
37
  def id_finder_names
38
38
  @id_finder_names ||= begin
39
- names = record_class.self_and_descendents_from_active_record.collect {|c| finder_name c}
39
+ names = descendants.collect {|c| finder_name c}
40
40
  names.uniq.collect {|n| "#{n}_id".to_sym}
41
41
  end
42
42
  end
43
43
 
44
44
  def model_finder_names
45
- @record_finder_names ||= record_class.self_and_descendents_from_active_record.collect {|c| finder_name(c).pluralize.to_sym}.uniq
45
+ @record_finder_names ||= descendants.collect {|c| finder_name(c).pluralize.to_sym}.uniq
46
46
  end
47
47
 
48
48
  def to_s
49
49
  "#<RecordMeta: #{table_name}>"
50
50
  end
51
51
 
52
+ def descendants
53
+ if record_class.respond_to?(:self_and_descendents_from_active_record)
54
+ record_class.self_and_descendents_from_active_record
55
+ else
56
+ record_class.self_and_descendants_from_active_record
57
+ end
58
+ end
59
+
52
60
  def finder_name(klass)
53
61
  klass.name.underscore.gsub('/', '_').sub(/^(\w)_/, '\1').gsub(/_(\w)_/, '_\1')
54
62
  end
55
63
  end
56
64
 
57
65
  end
58
- end
66
+ end
data/plugit/descriptor.rb CHANGED
@@ -9,12 +9,12 @@ Plugit.describe do |dataset|
9
9
 
10
10
  dataset.environment :default, 'Released versions of Rails and RSpec' do |env|
11
11
  env.library :rails, :export => "git clone git://github.com/rails/rails.git" do |rails|
12
- rails.after_update { `git fetch origin 2-2-stable:2-2-stable; git checkout 2-2-stable` }
12
+ rails.after_update { `git fetch origin 2-3-stable:2-3-stable; git checkout 2-3-stable` }
13
13
  rails.load_paths = %w{/activesupport/lib /activerecord/lib /actionpack/lib}
14
14
  rails.requires = %w{active_support active_record active_record/fixtures action_controller action_view}
15
15
  end
16
16
  env.library :rspec, :export => "git clone git://github.com/dchelimsky/rspec.git" do |rspec|
17
- rspec.after_update { `git checkout -b rspecrelease 1.1.11 && mkdir -p #{vendor_directory} && ln -nsf #{File.expand_path('.')} #{vendor_directory + '/rspec'}` }
17
+ rspec.after_update { `git checkout -b rspecrelease 1.1.12 && mkdir -p #{vendor_directory} && ln -nsf #{File.expand_path('.')} #{vendor_directory + '/rspec'}` }
18
18
  rspec.requires = %w{spec}
19
19
  end
20
20
  env.library :cucumber, :export => "git clone git://github.com/aslakhellesoy/cucumber.git" do |cukes|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aiwilliams-dataset
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Williams
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-08 00:00:00 -07:00
12
+ date: 2009-04-14 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15