raw_column 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f1b12dba1fa63bcbbf4b85450ea135d644b2519
4
- data.tar.gz: 8f6d88b5b5601482ad46e9676ddb8d659c7e739b
3
+ metadata.gz: 31bc310f6cb5fb393f8184a4d57832ab4d3ecb6c
4
+ data.tar.gz: d273d7ed0720dbb70de7cf08e5a9ba3fa008af54
5
5
  SHA512:
6
- metadata.gz: ac23693ccef23a8b3d2df8ed13c561a841bc0e63008298c75b7053cf5c97bd49883a25b3129993e2a0c7d8fbee8964cec6438a408695f7f440437731cebbd365
7
- data.tar.gz: a8f8fa4f6c55c645d5b1f8d1091eba079908d85dcc32a13a92aa1080abe84d1e9923b6d30decb73f2c3067ae10b683640b25de34ac03af429ca37f350d81f05b
6
+ metadata.gz: f05780ad848ae1f9deb18de04a309bba2da6c7ae225c60dced9bb26292dac7fdd84c9774ab3612cc7ac53322e24d8075bc979e35561325b40ffe9aabaffd09b0
7
+ data.tar.gz: fcd394ee18c9f62590ea57cba1b1e3b44e52353a7c0a2ca7ecdeb303e0f11a7a2b063c833210663bcd2c7c831e8cb679d06617eb377d347916a8a0dc4f5bdac0
data/README.md CHANGED
@@ -6,7 +6,7 @@ With rails 4 came support for postgresql json columns. Every now and again I fin
6
6
 
7
7
  So, yeah, here's a gem that does that for you.
8
8
 
9
- We don't need no stinking serialization.
9
+ You don't need no stinking serialization... sometimes.
10
10
 
11
11
  ## Installation
12
12
 
@@ -2,7 +2,7 @@ module RawColumn
2
2
 
3
3
  class JsonProxy
4
4
 
5
- def initialize(record, column_name=:content)
5
+ def initialize(record, column_name)
6
6
  @raw_content = record.send(:"#{column_name}_before_type_cast")
7
7
  end
8
8
 
@@ -1,3 +1,3 @@
1
1
  module RawColumn
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/raw_column.rb CHANGED
@@ -9,6 +9,7 @@ module RawColumn
9
9
 
10
10
  def raw_column(*column_names)
11
11
  class_eval do
12
+ column_names = [:content] if column_names.nil?
12
13
  column_names.each do |column_name|
13
14
  define_method :"raw_#{column_name}" do
14
15
  JsonProxy.new(self, column_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raw_column
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Schneider