Skip to content

Commit

Permalink
fixed an issue with class mappings that would not allow migrations to…
Browse files Browse the repository at this point in the history
… run when a class mapping pointed at an invalid rails model, fixed an issue that would not allow a property to be mapped between rails and flex when it had a number in it. eg: addressLine1

git-svn-id: http://rubyamf.googlecode.com/svn/trunk/rubyamf@1320 47e52f69-1a3c-0410-a923-c93d89df8d96
  • Loading branch information
andrew@gladhandle.com committed Oct 26, 2009
1 parent 9d267d8 commit b1057d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/configuration.rb
Expand Up @@ -53,10 +53,10 @@ def register(mapping) #register a value object map
if mapping[:type] == "active_record"
@attribute_names[mapping[:ruby]] = (mapping[:ruby].constantize.new.attribute_names + ["id"]).inject({}){|hash, attr| hash[attr]=true ; hash} # include the id attribute
end
rescue ActiveRecord::StatementInvalid => e
rescue StandardError => e
# This error occurs during migrations, since the AR constructed above will check its columns, but the table won't exist yet.
# We'll ignore the error if we're migrating.
raise unless ARGV.include?("migrate") or ARGV.include?("db:migrate")
raise unless ARGV.include?("migrate") or ARGV.include?("db:migrate") or ARGV.include?("rollback") or ARGV.include?("db:rollback")
end
end

Expand Down
2 changes: 1 addition & 1 deletion util/string.rb
Expand Up @@ -3,7 +3,7 @@ class String
def to_snake! # no one should change these unless they can benchmark and prove their way is faster. =)
@cached_snake_strings ||= {}
@cached_snake_strings[self] ||= (
while x = index(/([a-z\d])([A-Z])/) # unfortunately have to use regex for this one
while x = index(/([a-z\d])([A-Z\d])/) # unfortunately have to use regex for this one
y=x+1
self[x..y] = self[x..x]+"_"+self[y..y].downcase
end
Expand Down

0 comments on commit b1057d4

Please sign in to comment.