brendan-entrails 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/entrails.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{entrails}
3
- s.version = "1.0.5"
3
+ s.version = "1.0.6"
4
4
 
5
5
  s.specification_version = 2 if s.respond_to? :specification_version=
6
6
 
data/lib/entrails.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Entrails
2
- VERSION='1.0.4'
2
+ VERSION='1.0.6'
3
3
  AUTHORS=["Brendan Baldwin"]
4
4
  EMAIL=["brendan@usergenic.com"]
5
5
  DESCRIPTION=%q{This is a collection of extensions to Rails internals that I've found to be absolutely indispensible since I implimented them. The real action is happening in the following two files at the moment: http://github.com/brendan/entrails/tree/master/lib/entrails/active_record/better_conditions.rb http://github.com/brendan/entrails/tree/master/lib/entrails/active_record/find_by_association.rb}
@@ -162,8 +162,10 @@ module Entrails::ActiveRecord::FindByAssociation
162
162
  match = /^find_(all_by|by)_([_a-zA-Z]\w*)$/.match(method_id.to_s)
163
163
  match = /^find_or_(initialize|create)_by_([_a-zA-Z]\w*)$/.match(method_id.to_s) unless match
164
164
  if match
165
- action_type = ($1 =~ /by/) ? :finder : :instantiator
166
- attribute_names = $2.split(/_and_/)
165
+ action_type_segment = $1
166
+ attribute_names_segment = $2
167
+ action_type = (action_type_segment =~ /by/) ? :finder : :instantiator
168
+ attribute_names = attribute_names_segment.split(/_and_/)
167
169
  options_argument = (arguments.size > attribute_names.size) ? arguments.last : {}
168
170
  associations = {}
169
171
  index = 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brendan-entrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendan Baldwin