auxiliary_addons 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -11,7 +11,7 @@ Quick Start
11
11
  =======
12
12
  In your Gemfile:
13
13
 
14
- gem "auxiliary_addons", ">= 0.5.4"
14
+ gem "auxiliary_addons", ">= 0.5.5"
15
15
 
16
16
  Installation
17
17
  =======
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
  Gem::Specification.new do |s|
3
3
  s.name = %q{auxiliary_addons}
4
- s.version = "0.5.4"
4
+ s.version = "0.5.5"
5
5
  s.date = Date.today.to_s
6
6
  s.summary = %q{AuxiliaryAddons is a gem that contains basic helpers.}
7
7
  s.description = %q{AuxiliaryAddons is a gem that contains basic helpers.}
data/changelog CHANGED
@@ -14,6 +14,7 @@ that bug was created for 1.0 version of the AntHill component, bug is feature re
14
14
 
15
15
  Version 0.5
16
16
  -----------
17
+ 0.5 { Bug Report } [ AuxiliaryAddons ] / X / Add tableless31_model for Rails 3.1.x
17
18
  0.5 { Bug Report } [ AuxiliaryAddons ] / X / Ruby 2.5.x support
18
19
  0.5 { Bug Report } [ AuxiliaryAddons ] / X / Handle special case (all selected) at cast_ids_to_i function
19
20
  0.5 { Bug Report } [ AuxiliaryAddons ] / X / Changelog, roadmap, knownbugs have been created
@@ -0,0 +1,36 @@
1
+ #
2
+ # See http://railscasts.com/episodes/193-tableless-model
3
+ #
4
+ class Tableless31Model < ActiveRecord::Base
5
+
6
+ def self.columns
7
+ @columns ||= [];
8
+ end
9
+
10
+ def self.column(name, sql_type = nil, default = nil, null = true)
11
+ columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default,
12
+ sql_type.to_s, null)
13
+ end
14
+
15
+ def self.columns_hash
16
+ @columns_hash ||= Hash[columns.map { |column| [column.name, column] }]
17
+ end
18
+
19
+ def self.column_names
20
+ @column_names ||= columns.map { |column| column.name }
21
+ end
22
+
23
+ def self.column_defaults
24
+ @column_defaults ||= columns.map { |column| [column.name, nil] }.inject({}) { |m, e| m[e[0]] = e[1]; m }
25
+ end
26
+
27
+ # Override the save method to prevent exceptions.
28
+ def save(validate = true)
29
+ validate ? valid? : true
30
+ end
31
+
32
+ def initialize(attributes = nil)
33
+ super(attributes)
34
+ end
35
+
36
+ end
@@ -12,6 +12,7 @@ require 'auxiliary_addons/ruby_addons'
12
12
  # Only for Rails 3.x
13
13
  if Rails::VERSION::MAJOR >= 3
14
14
  require 'auxiliary_addons/tableless_model'
15
+ require 'auxiliary_addons/tableless31_model'
15
16
  require 'auxiliary_addons/validateable_model'
16
17
  end
17
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auxiliary_addons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-16 00:00:00.000000000Z
12
+ date: 2012-03-15 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: AuxiliaryAddons is a gem that contains basic helpers.
15
15
  email: developers@majoron.com
@@ -29,6 +29,7 @@ files:
29
29
  - lib/auxiliary_addons/jscript_helper.rb
30
30
  - lib/auxiliary_addons/list_helper.rb
31
31
  - lib/auxiliary_addons/ruby_addons.rb
32
+ - lib/auxiliary_addons/tableless31_model.rb
32
33
  - lib/auxiliary_addons/tableless_model.rb
33
34
  - lib/auxiliary_addons/validateable_model.rb
34
35
  - lib/auxiliary_addons.rb