scaffolding_extensions 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -21,14 +21,14 @@ to better suit your needs.
21
21
  Scaffolding Extensions currently supports:
22
22
 
23
23
  * Web Frameworks
24
- * Rails 3.0.9
24
+ * Rails 3.1.0
25
25
  * Ramaze 2011.01.30
26
26
  * Camping 2.1
27
27
  * Sinatra 1.2.6
28
28
  * Rack 1.2.2
29
29
  * Object Relational Mappers
30
- * ActiveRecord 3.0.9
31
- * Sequel 3.25.0
30
+ * ActiveRecord 3.1.0
31
+ * Sequel 3.27.0
32
32
  * DataMapper 1.0.2 (see doc/datamapper.txt for details)
33
33
  * Javascript Libaries (used for Ajax/Autocompleting, default is now JQuery)
34
34
  * Prototype 1.6.0.3
@@ -78,7 +78,7 @@ module ScaffoldingExtensions::MetaActiveRecord
78
78
  fields = columns.reject{|c| c.primary || c.name =~ /(\A(created|updated)_at|_count)\z/ || c.name == inheritance_column}.collect{|c| c.name}
79
79
  scaffold_all_associations.each do |reflection|
80
80
  next if reflection.macro != :belongs_to || reflection.options.include?(:polymorphic)
81
- fields.delete(reflection.primary_key_name)
81
+ fields.delete(reflection.foreign_key)
82
82
  fields.push(reflection.name.to_s)
83
83
  end
84
84
  @scaffold_fields = fields.sort.collect{|f| f.to_sym}
@@ -86,7 +86,7 @@ module ScaffoldingExtensions::MetaActiveRecord
86
86
 
87
87
  # The foreign key for the given reflection
88
88
  def scaffold_foreign_key(reflection)
89
- reflection.primary_key_name
89
+ reflection.foreign_key
90
90
  end
91
91
 
92
92
  # Retrieve a single model object given an id
@@ -103,7 +103,7 @@ module ScaffoldingExtensions::MetaActiveRecord
103
103
  # Return the class, left foreign key, right foreign key, and join table for this habtm association
104
104
  def scaffold_habtm_reflection_options(association)
105
105
  reflection = reflect_on_association(association)
106
- [reflection.klass, reflection.primary_key_name, reflection.association_foreign_key, reflection.options[:join_table]]
106
+ [reflection.klass, reflection.foreign_key, reflection.association_foreign_key, reflection.options[:join_table]]
107
107
  end
108
108
 
109
109
  # Returns a hash of values to be used as url parameters on the link to create a new
@@ -112,7 +112,7 @@ module ScaffoldingExtensions::MetaActiveRecord
112
112
  # the association's reflection's options.
113
113
  def scaffold_new_associated_object_values(association, record)
114
114
  reflection = reflect_on_association(association)
115
- vals = {reflection.primary_key_name=>record.id}
115
+ vals = {reflection.foreign_key=>record.id}
116
116
  vals["#{reflection.options[:as]}_type"] = name if reflection.options.include?(:as)
117
117
  vals
118
118
  end
@@ -169,7 +169,7 @@ module ScaffoldingExtensions::MetaActiveRecord
169
169
  # Updates associated records for a given reflection and from record to point to the
170
170
  # to record
171
171
  def scaffold_reflection_merge(reflection, from, to)
172
- foreign_key = reflection.primary_key_name
172
+ foreign_key = reflection.foreign_key
173
173
  sql = case reflection.macro
174
174
  when :has_one, :has_many
175
175
  return if reflection.options[:through]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffolding_extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 2
10
- version: 1.5.2
9
+ - 3
10
+ version: 1.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Evans
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-02 00:00:00 -07:00
18
+ date: 2011-08-31 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21