Skip to content

Commit

Permalink
[#839 state:resolved] Ruby 1.9.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlarsen committed Nov 1, 2010
1 parent 1d7255b commit 67b3a23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion hobo/lib/hobo/accessible_associations.rb
Expand Up @@ -9,7 +9,11 @@ def prepare_has_many_assignment(association, association_name, array_or_hash)

array = params_hash_to_array(array_or_hash)
array.map! do |record_hash_or_string|
finder = association.member_class.scoped :conditions => association.conditions
if association.conditions.nil?
finder = association.member_class
else
finder = association.member_class.scoped :conditions => association.conditions
end
find_or_create_and_update(owner, association_name, finder, record_hash_or_string) do |id|
# The block is required to either locate find an existing record in the collection, or build a new one
if id
Expand Down
2 changes: 1 addition & 1 deletion hobo/lib/hobo/scopes/named_scope_extensions.rb
Expand Up @@ -13,7 +13,7 @@ def respond_to?(method, include_private=false)
private

def method_missing(method, *args, &block)
if respond_to?(method) && scopes.include?(method)
if scopes.include?(method)
scopes[method].call(self, *args)
else
with_scope :find => proxy_options do
Expand Down
2 changes: 1 addition & 1 deletion hobofields/test/test_hobofield_model_generator.rb
Expand Up @@ -4,7 +4,7 @@
# we get a SystemStackError on JRuby
exit(0) if defined? JRUBY_VERSION

require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
require "./#{File.join(File.dirname(__FILE__), 'test_generator_helper.rb')}"

class TestHobofieldModelGenerator < Test::Unit::TestCase
include RubiGen::GeneratorTestHelper
Expand Down

2 comments on commit 67b3a23

@betelgeuse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to fully support ruby 1.9.2 please test STI too. It's currently broken.

@betelgeuse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.