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 3, 2010
1 parent c711224 commit 07362c9
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 07362c9

Please sign in to comment.