Permalink
Browse files

Eliminate deprecation warnings with Rails 3.1.0, bump version to 1.5.3

  • Loading branch information...
1 parent ccd379b commit 8c716f5ed589da0a94fcd1b5a0ec80d71df299b5 @jeremyevans committed Sep 1, 2011
View
6 README
@@ -21,14 +21,14 @@ to better suit your needs.
Scaffolding Extensions currently supports:
* Web Frameworks
- * Rails 3.0.9
+ * Rails 3.1.0
* Ramaze 2011.01.30
* Camping 2.1
* Sinatra 1.2.6
* Rack 1.2.2
* Object Relational Mappers
- * ActiveRecord 3.0.9
- * Sequel 3.25.0
+ * ActiveRecord 3.1.0
+ * Sequel 3.27.0
* DataMapper 1.0.2 (see doc/datamapper.txt for details)
* Javascript Libaries (used for Ajax/Autocompleting, default is now JQuery)
* Prototype 1.6.0.3
@@ -78,15 +78,15 @@ def scaffold_fields(action = :default)
fields = columns.reject{|c| c.primary || c.name =~ /(\A(created|updated)_at|_count)\z/ || c.name == inheritance_column}.collect{|c| c.name}
scaffold_all_associations.each do |reflection|
next if reflection.macro != :belongs_to || reflection.options.include?(:polymorphic)
- fields.delete(reflection.primary_key_name)
+ fields.delete(reflection.foreign_key)
fields.push(reflection.name.to_s)
end
@scaffold_fields = fields.sort.collect{|f| f.to_sym}
end
# The foreign key for the given reflection
def scaffold_foreign_key(reflection)
- reflection.primary_key_name
+ reflection.foreign_key
end
# Retrieve a single model object given an id
@@ -103,7 +103,7 @@ def scaffold_get_objects(options)
# Return the class, left foreign key, right foreign key, and join table for this habtm association
def scaffold_habtm_reflection_options(association)
reflection = reflect_on_association(association)
- [reflection.klass, reflection.primary_key_name, reflection.association_foreign_key, reflection.options[:join_table]]
+ [reflection.klass, reflection.foreign_key, reflection.association_foreign_key, reflection.options[:join_table]]
end
# Returns a hash of values to be used as url parameters on the link to create a new
@@ -112,7 +112,7 @@ def scaffold_habtm_reflection_options(association)
# the association's reflection's options.
def scaffold_new_associated_object_values(association, record)
reflection = reflect_on_association(association)
- vals = {reflection.primary_key_name=>record.id}
+ vals = {reflection.foreign_key=>record.id}
vals["#{reflection.options[:as]}_type"] = name if reflection.options.include?(:as)
vals
end
@@ -169,7 +169,7 @@ def scaffold_merge_conditions(conditions)
# Updates associated records for a given reflection and from record to point to the
# to record
def scaffold_reflection_merge(reflection, from, to)
- foreign_key = reflection.primary_key_name
+ foreign_key = reflection.foreign_key
sql = case reflection.macro
when :has_one, :has_many
return if reflection.options[:through]
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = "scaffolding_extensions"
- s.version = '1.5.2'
+ s.version = '1.5.3'
s.author = "Jeremy Evans"
s.email = "code@jeremyevans.net"
s.platform = Gem::Platform::RUBY
View
@@ -1,5 +1,5 @@
require 'rubygems'
-gem 'rails', '3.0.9'
+gem 'rails', '3.1.0'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
@@ -11,7 +11,6 @@
# Show full error reports and disable caching
config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
@@ -45,5 +45,5 @@
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
- config.active_support.deprecation = :notify
+ config.active_support.deprecation = :log
end

0 comments on commit 8c716f5

Please sign in to comment.