aggregate_columns 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/aggregate_columns.rb +2 -2
  3. metadata +3 -3
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ PKG_FILES = FileList[
14
14
 
15
15
  spec = Gem::Specification.new do |s|
16
16
  s.name = "aggregate_columns"
17
- s.version = "0.9.2"
17
+ s.version = "0.9.3"
18
18
  s.author = "Marek Janukowicz"
19
19
  s.email = "marek@janukowicz.net"
20
20
  s.homepage = "http://www.bitbucket.org/starware/aggregate_columns"
@@ -47,7 +47,7 @@ module AggregateColumns
47
47
 
48
48
  module MethodsRails3
49
49
 
50
- def aggregate_column( options )
50
+ def aggregate_columns( options )
51
51
  rel = self.select( "#{table_name}.*" )
52
52
  # Process options
53
53
  options.assert_valid_keys( :association, :column, :function, :result_column, :join_type )
@@ -73,7 +73,7 @@ module AggregateColumns
73
73
  klass = assoc_reflection.klass
74
74
  join_type = options[:join_type] || "LEFT" # TODO: check if within allowed values
75
75
 
76
- aggregate_rel = klass.select( "#{function}(#{field}) AS #{result_column}" ).from( aggregate_table_name ).where( "#{table_name}.id = #{result_column}_join.#{foreign_key}" )
76
+ aggregate_rel = klass.select( "#{function}(#{field}) AS #{result_column}" ).from( aggregate_table_name ).where( "#{table_name}.id = #{foreign_key}" )
77
77
  #aggregate_rel = klass.select( "#{foreign_key}, #{function}(#{field}) AS #{result_column}" ).from( aggregate_table_name ).group( foreign_key )
78
78
  aggregate_rel = yield( aggregate_rel ) if block_given?
79
79
  rel = rel.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggregate_columns
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 2
10
- version: 0.9.2
9
+ - 3
10
+ version: 0.9.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marek Janukowicz