anonymous_active_record 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06cc5b89d0dd74bf695170d403d5e13cf43890ad4dec496d4277ace4a02fa0a6
4
- data.tar.gz: 447127ce3f3cdfc5ad4ac3b9112ab0d674847756e90cb7eb7606bb2cab828475
3
+ metadata.gz: f98e9d83df30da94c3734c15029a884b89b128208c95036fd24f1f6575f919cd
4
+ data.tar.gz: 15f9c85d4bd048b4dd5bf94600976b7dc62df326fde06fb140f8a15b166a9cf7
5
5
  SHA512:
6
- metadata.gz: ea9a4e359af2441fd4a111027a7563d505296051bf027f0380e05b8d1531b9242fa89294809ca8d7a9335d67c1009748d051dedade71ec9c3053ff0e38079ade
7
- data.tar.gz: 4f0913bd9ec3382efde4a4a70a6f979332bc6c224b1560ac30c3da50188d61b3c3fac9a51a05a12378e39398d2e8ecfc3d10e9bbffd0b50cf17b2797e7aacea9
6
+ metadata.gz: 70c19951a270ef60b83296617029def5b5e24d8cf7e997c414a68eeb6730486f552f4ca27583344f2e3a91627cca583eea278aace70c07641c25c4c75146bb2e
7
+ data.tar.gz: 8848311f3fa1c4f3293a8a5be74621a1da710cf570dab69dc4b139e3b6fb69d7561c628d78f640b1b3f1ec827269453207c3a85ff9397a20ae39662ac63f318b
data/Gemfile CHANGED
@@ -5,11 +5,15 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
5
5
  group :test do
6
6
  ruby_version = Gem::Version.new(RUBY_VERSION)
7
7
  if ruby_version >= Gem::Version.new('2.1')
8
- gem 'rubocop', '~> 0.59.0'
9
- gem 'rubocop-rspec', '~> 1.24.0'
8
+ gem 'rubocop', '~> 0.60.0'
9
+ gem 'rubocop-rspec', '~> 1.30.0'
10
10
  end
11
- gem 'pry', '~> 0.11' if ruby_version >= Gem::Version.new('2.0')
12
- gem 'simplecov', require: false, group: :test
11
+ if ruby_version >= Gem::Version.new('2.0')
12
+ gem 'byebug', '~> 10', platform: :mri, require: false
13
+ gem 'pry', '~> 0', platform: :mri, require: false
14
+ gem 'pry-byebug', '~> 3', platform: :mri, require: false
15
+ end
16
+ gem 'simplecov', '~> 0', require: false
13
17
  end
14
18
 
15
19
  # Specify your gem's dependencies in anonymous_active_record.gemspec
data/README.md CHANGED
@@ -102,6 +102,8 @@ AnonymousActiveRecord.generate(
102
102
  columns: ['name'],
103
103
  # default is [],
104
104
  # meaning class will have ['id', 'created_at', 'updated_at'], as the AR defaults
105
+ # Optionally provide an array of hashes and thereby designate column type:
106
+ # [{name: 'name', type: 'string'}, {name: 'baked_at', type: 'time'}]
105
107
  timestamps: true, # is default
106
108
  connection_params: { adapter: 'sqlite3', encoding: 'utf8', database: ':memory:' } # is default
107
109
  ) do
@@ -167,7 +169,7 @@ spec.add_dependency 'anonymous_active_record', '~> 0.0'
167
169
 
168
170
  [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fpboling%2Fanonymous_active_record.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fpboling%2Fanonymous_active_record?ref=badge_large)
169
171
 
170
- [license]: LICENSE.txt
172
+ [license]: LICENSE
171
173
  [semver]: http://semver.org/
172
174
  [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
173
175
  [railsbling]: http://www.railsbling.com
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.required_ruby_version = '>= 2.4' # Requirement for Ruby String#capitalize
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1'
26
- spec.add_development_dependency 'byebug', '~> 10'
27
26
  spec.add_development_dependency 'rake', '~> 12'
28
27
  spec.add_development_dependency 'rspec', '~> 3'
29
28
  spec.add_development_dependency 'sqlite3', '~> 1'
@@ -1,3 +1,3 @@
1
1
  module AnonymousActiveRecord
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -50,7 +50,11 @@ module AnonymousActiveRecord
50
50
  klass.connection.create_table gen.table_name do |t|
51
51
  t.column :text, :text
52
52
  columns.each do |col|
53
- t.column col, :string
53
+ if col.is_a?(Hash)
54
+ t.column col[:name], col[:type]
55
+ else
56
+ t.column col, :string
57
+ end
54
58
  end
55
59
  t.timestamps if timestamps
56
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anonymous_active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-10 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1'
27
- - !ruby/object:Gem::Dependency
28
- name: byebug
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '10'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '10'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
122
  version: '0'
137
123
  requirements: []
138
124
  rubyforge_project:
139
- rubygems_version: 2.7.7
125
+ rubygems_version: 2.7.8
140
126
  signing_key:
141
127
  specification_version: 4
142
128
  summary: Almost Anonymous ActiveRecord classes