Created
May 12, 2011 16:17
-
-
Save dissolved/968850 to your computer and use it in GitHub Desktop.
Problem with Dynamic Finders in seeds.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/seeds.rb | |
orig = Security.create!(symbol:'NFLX', name:'Overvalued Content Provider') | |
puts Security.all | |
puts orig.symbol | |
s = Security.find_by_symbol(orig.symbol) | |
puts s.nil? ? "not found" : "found" | |
s = Security.find(orig.id) | |
puts s.nil? ? "not found" : "found" | |
# Output | |
# Overvalued Content Provider (NFLX) | |
# NFLX | |
# not found | |
# found |
Eureka... the annotate gem was installed... and within it, is the following code:
module ::ActiveRecord
class Base
def self.method_missing(name, *args)
# ignore this, so unknown/unloaded macros won't cause parsing to fail
end
end
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've reproduced this output so far with both SQLite3 and MySQL. Using Rails 3.0.7 and Ruby 1.9.2p0