sneaky-save 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODk3MmJjYTNiNTEzZWRhOTNkZjQ2NDUzNGUxZjQyNTIzY2Q2NzUzMg==
5
+ data.tar.gz: !binary |-
6
+ ZGVlZTc2ZWE2MTljNzU5ZDEzZWY0ZTRhNmY2ODRkYTcwYjI0Yjc1Yw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ Zjg0MTRkOTZmNDk1YzhiZWEwOGM4MmJlNThmNGUwZjUzNDNjZDJhNzhhZTg2
10
+ ZTdhNmIyYjEzODJiN2U4ZjEwMjNmYWZjZWNhOGM5NmEwNDQyMTEzMjZjMzcw
11
+ Y2UwNjlmZmI5YjUzYTVlYjllMGVmMTJkMTYwMGRlZjEzOTk5ZTc=
12
+ data.tar.gz: !binary |-
13
+ OGNjZWI0ZmJlZjM5ZTllZWMzMmUyOGQ4YTg4MjY1MTRlMDlmZThlYTcyN2Yx
14
+ MGIxZjBmOGRiNDRlZmMxMDFmMTgzMmFhNjNmNjFlZGRhOGM5OTU1ZDNjMjI5
15
+ Zjk0MTYzZDkwNThjNDI1MDA2NmI0YzkxODI0MTI2NTAwMTJjNjA=
data/.gitignore CHANGED
@@ -22,3 +22,7 @@ doc
22
22
 
23
23
  # jeweler generated
24
24
  pkg
25
+
26
+ .ruby-version
27
+
28
+ Gemfile.lock
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
data/Gemfile CHANGED
@@ -1,14 +1,8 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
- gem "activerecord"
4
-
5
- group :development do
6
- gem "bundler", "~> 1.0.0"
7
- gem "jeweler", "~> 1.6.2"
8
- end
3
+ gemspec
9
4
 
10
5
  group :test do
11
- gem "rcov", ">= 0"
12
- gem 'rspec'
13
- gem "sqlite3-ruby"
6
+ gem 'rake'
7
+ gem 'sqlite3'
14
8
  end
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # sneaky-save
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/sneaky-save.png)](http://badge.fury.io/rb/sneaky-save)
4
+ [![Build Status](https://travis-ci.org/einzige/sneaky-save.png?branch=master)](https://travis-ci.org/einzige/sneaky-save)
5
+
3
6
  ActiveRecord extension. Allows to save record without calling callbacks and validations.
4
7
 
5
8
  ## Installing
@@ -9,7 +12,7 @@ $ gem install sneaky-save
9
12
 
10
13
  Or put in your gemfile for latest version:
11
14
  ```ruby
12
- gem 'sneaky-save', git: 'git://github.com/partyearth/sneaky-save.git'
15
+ gem 'sneaky-save', git: 'git://github.com/einzige/sneaky-save.git'
13
16
  ```
14
17
 
15
18
  ## Using
@@ -34,7 +37,3 @@ Model.new.sneaky_save
34
37
  - Commit and push until you are happy with your contribution
35
38
  - Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
36
39
  - Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
37
-
38
- ## Copyright
39
-
40
- Copyright (c) 2011 PartyEarth LLC. See LICENSE.txt for details.
data/Rakefile CHANGED
@@ -1,58 +1,5 @@
1
- # encoding: utf-8
1
+ #!/usr/bin/env rake
2
2
 
3
- ENV['BUNDLE_GEMFILE'] = 'Gemfile'
4
-
5
- gem_root = File.expand_path(File.dirname(__FILE__))
6
-
7
- require 'rubygems'
8
- require 'bundler'
9
- require 'rake'
10
- require 'jeweler'
11
- require 'rake'
12
- require 'rake/testtask'
13
- require 'rspec'
14
3
  require 'rspec/core/rake_task'
15
-
16
- begin
17
- Bundler.setup(:default, :development)
18
- rescue Bundler::BundlerError => e
19
- $stderr.puts e.message
20
- $stderr.puts "Run `bundle install` to install missing gems"
21
- exit e.status_code
22
- end
23
-
24
- Jeweler::Tasks.new do |gem|
25
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
26
- gem.name = "sneaky-save"
27
- gem.homepage = "http://github.com/partyearth/sneaky-save"
28
- gem.license = "MIT"
29
- gem.summary = %Q{Kevin, please add summary.}
30
- gem.description = %Q{Longer description of our gem}
31
- gem.email = "kgoslar@partyearth.ru"
32
- gem.authors = ["Sergei Zinin", "Kevin Goslar"]
33
- gem.files = Dir.glob('lib/**/*.rb')
34
- # dependencies defined in Gemfile
35
- end
36
- Jeweler::RubygemsDotOrgTasks.new
37
-
38
- task :default => :spec
39
-
40
- desc "Run the test suite"
41
- task :spec => ['spec:setup', 'spec:lib', 'spec:cleanup']
42
-
43
- namespace :spec do
44
- desc "Setup the test environment"
45
- task :setup do
46
- system "cd #{gem_root} && bundle install && mkdir db"
47
- end
48
-
49
- desc "Cleanup the test environment"
50
- task :cleanup do
51
- FileUtils.rm_rf "#{gem_root}/db"
52
- end
53
-
54
- desc "Test the SneakySave lib"
55
- RSpec::Core::RakeTask.new(:lib) do |task|
56
- task.pattern = gem_root + '/spec/lib/**/*_spec.rb'
57
- end
58
- end
4
+ RSpec::Core::RakeTask.new :spec
5
+ task default: :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -24,19 +24,19 @@ module SneakySave
24
24
  # Makes INSERT query in database without running any callbacks
25
25
  # @return [false, true]
26
26
  def sneaky_create
27
- if self.id.nil? && connection.prefetch_primary_key?(self.class.table_name)
28
- self.id = connection.next_sequence_value(self.class.sequence_name)
27
+ if self.id.nil? && self.class.connection.prefetch_primary_key?(self.class.table_name)
28
+ self.id = self.class.connection.next_sequence_value(self.class.sequence_name)
29
29
  end
30
30
 
31
- attributes_values = send :arel_attributes_values
31
+ attributes_values = send :arel_attributes_with_values_for_create, attribute_names
32
32
 
33
33
  # Remove the id field for databases like Postgres which will raise an error on id being NULL
34
- if self.id.nil? && !connection.prefetch_primary_key?(self.class.table_name)
34
+ if self.id.nil? && !self.class.connection.prefetch_primary_key?(self.class.table_name)
35
35
  attributes_values.reject! { |key,_| key.name == 'id' }
36
36
  end
37
37
 
38
38
  new_id = if attributes_values.empty?
39
- self.class.unscoped.insert connection.empty_insert_statement_value
39
+ self.class.unscoped.insert self.class.connection.empty_insert_statement_value
40
40
  else
41
41
  self.class.unscoped.insert attributes_values
42
42
  end
@@ -55,7 +55,7 @@ module SneakySave
55
55
  # Here we have changes --> save them.
56
56
  pk = self.class.primary_key
57
57
  original_id = changed_attributes.has_key?(pk) ? changes[pk].first : send(pk)
58
- !self.class.update_all(attributes, pk => original_id).zero?
58
+ !self.class.where(pk => original_id).update_all(attributes).zero?
59
59
  end
60
60
  end
61
61
 
@@ -2,39 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sneaky-save}
5
- s.version = "0.0.4"
5
+ s.version = '0.0.5'
6
+
7
+ s.date = %q{2013-12-09}
8
+ s.authors = ["Sergei Zinin (einzige)"]
9
+ s.email = %q{zinin@xakep.ru}
10
+ s.homepage = %q{http://github.com/einzige/sneaky-save}
6
11
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Sergei Zinin", "Kevin Goslar"]
9
- s.date = %q{2013-02-21}
10
- s.description = %q{ActiveRecord extension. Allows to save record without calling callbacks and validations.}
11
- s.email = %q{kgoslar@partyearth.com}
12
- s.extra_rdoc_files = [
13
- "LICENSE.txt",
14
- "README.md"
15
- ]
16
- s.files = `git ls-files`.split("\n")
17
- s.homepage = %q{http://github.com/partyearth/sneaky-save}
18
12
  s.licenses = ["MIT"]
13
+
14
+ s.files = `git ls-files`.split("\n")
19
15
  s.require_paths = ["lib"]
20
- s.rubygems_version = %q{1.6.2}
21
- s.summary = %q{Allows to save record without calling callbacks and validations.}
16
+ s.extra_rdoc_files = ["README.md"]
22
17
 
23
- if s.respond_to? :specification_version then
24
- s.specification_version = 3
18
+ s.description = %q{ActiveRecord extension. Allows to save record without calling callbacks and validations.}
19
+ s.summary = %q{Allows to save record without calling callbacks and validations.}
25
20
 
26
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
- s.add_runtime_dependency(%q<activerecord>, [">= 3.2.0"])
28
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
29
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
30
- else
31
- s.add_dependency(%q<activerecord>, [">= 3.2.0"])
32
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
33
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
34
- end
35
- else
36
- s.add_dependency(%q<activerecord>, [">= 3.2.0"])
37
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
38
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
39
- end
21
+ s.add_runtime_dependency 'activerecord', ">= 3.2.0"
22
+ s.add_development_dependency 'rspec'
40
23
  end
@@ -1,67 +1,66 @@
1
1
  require 'spec_helper'
2
- require 'fixtures'
3
2
 
4
- describe SneakySave do
3
+ describe SneakySave, use_connection: true do
5
4
  after :each do
6
5
  subject.sneaky_save.should be_true
7
6
  end
8
7
 
9
- context "new record" do
8
+ context 'new record' do
10
9
  subject { Fake.new }
11
10
 
12
- it("returns true if everything is good") {}
11
+ it('returns true if everything is good') {}
13
12
 
14
- it "does insert of the new record" do
13
+ it 'does insert of the new record' do
15
14
  subject.should_receive(:sneaky_create).once.and_return true
16
15
  end
17
16
 
18
- it "stores attributes in database" do
19
- subject.name = "test"
17
+ it 'stores attributes in database' do
18
+ subject.name = 'test'
20
19
  subject.sneaky_save
21
20
  subject.reload
22
- subject.name.should == "test"
21
+ subject.name.should == 'test'
23
22
  end
24
23
 
25
- it "does not call any callback" do
24
+ it 'does not call any callback' do
26
25
  Fake.any_instance.should_not_receive :before_save_callback
27
26
  end
28
27
 
29
- it "does not call validations" do
28
+ it 'does not call validations' do
30
29
  Fake.any_instance.should_not_receive :valid?
31
30
  end
32
31
  end
33
32
 
34
- context "existing record" do
35
- subject { Fake.create :name => "test" }
33
+ context 'existing record' do
34
+ subject { Fake.create :name => 'test' }
36
35
 
37
- context "record is not changed" do
38
- it "does nothing" do
36
+ context 'record is not changed' do
37
+ it 'does nothing' do
39
38
  Fake.should_not_receive(:update_all)
40
39
  end
41
40
  end
42
41
 
43
- context "record is changed" do
42
+ context 'record is changed' do
44
43
  after :each do
45
44
  subject.name = 'new name'
46
45
  end
47
46
 
48
- it "updates attributes" do
47
+ it 'updates attributes' do
49
48
  subject.should be_valid
50
49
  subject.should_receive(:sneaky_update).once.and_return true
51
50
  end
52
51
 
53
- it "stores attributes in database" do
54
- subject.name = "new name"
52
+ it 'stores attributes in database' do
53
+ subject.name = 'new name'
55
54
  subject.sneaky_save.should be_true
56
55
  subject.reload
57
- subject.name.should == "new name"
56
+ subject.name.should == 'new name'
58
57
  end
59
58
 
60
- it "does not call any callback" do
59
+ it 'does not call any callback' do
61
60
  subject.should_not_receive :before_save_callback
62
61
  end
63
62
 
64
- it "does not call validations" do
63
+ it 'does not call validations' do
65
64
  subject.should_not_receive :valid?
66
65
  end
67
66
  end
@@ -1,9 +1,30 @@
1
- require "active_record"
2
- require "logger"
3
- require "rspec"
4
- require "sneaky-save"
1
+ require 'active_record'
2
+ require 'sqlite3'
3
+ require 'sneaky-save'
5
4
 
6
- RSpec.configure { |config| config.mock_with :rspec }
5
+ shared_context 'use connection', use_connection: true do
6
+ ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
7
7
 
8
- ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "db/sqlite3.test.db")
9
- ActiveRecord::Base.logger = Logger.new(STDOUT)
8
+ ActiveRecord::Schema.define do
9
+ create_table 'fakes' do |table|
10
+ table.column :name, :string
11
+ end
12
+ end
13
+
14
+ class Fake < ActiveRecord::Base
15
+ validates_presence_of :name
16
+
17
+ before_save :before_save_callback
18
+
19
+ def before_save_callback
20
+ 'BEFORE SAVE CALLED'
21
+ end
22
+ end
23
+ end
24
+
25
+
26
+ RSpec.configure do |config|
27
+ config.mock_with :rspec
28
+ config.color_enabled = true
29
+ config.formatter = :documentation
30
+ end
metadata CHANGED
@@ -1,21 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sneaky-save
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
- - Sergei Zinin
9
- - Kevin Goslar
7
+ - Sergei Zinin (einzige)
10
8
  autorequire:
11
9
  bindir: bin
12
10
  cert_chain: []
13
- date: 2013-02-21 00:00:00.000000000 Z
11
+ date: 2013-12-09 00:00:00.000000000 Z
14
12
  dependencies:
15
13
  - !ruby/object:Gem::Dependency
16
14
  name: activerecord
17
15
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
16
  requirements:
20
17
  - - ! '>='
21
18
  - !ruby/object:Gem::Version
@@ -23,87 +20,64 @@ dependencies:
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
23
  requirements:
28
24
  - - ! '>='
29
25
  - !ruby/object:Gem::Version
30
26
  version: 3.2.0
31
27
  - !ruby/object:Gem::Dependency
32
- name: bundler
28
+ name: rspec
33
29
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
30
  requirements:
36
- - - ~>
37
- - !ruby/object:Gem::Version
38
- version: 1.0.0
39
- type: :development
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- version: 1.0.0
47
- - !ruby/object:Gem::Dependency
48
- name: jeweler
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
31
+ - - ! '>='
53
32
  - !ruby/object:Gem::Version
54
- version: 1.6.2
33
+ version: '0'
55
34
  type: :development
56
35
  prerelease: false
57
36
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
37
  requirements:
60
- - - ~>
38
+ - - ! '>='
61
39
  - !ruby/object:Gem::Version
62
- version: 1.6.2
40
+ version: '0'
63
41
  description: ActiveRecord extension. Allows to save record without calling callbacks
64
42
  and validations.
65
- email: kgoslar@partyearth.com
43
+ email: zinin@xakep.ru
66
44
  executables: []
67
45
  extensions: []
68
46
  extra_rdoc_files:
69
- - LICENSE.txt
70
47
  - README.md
71
48
  files:
72
49
  - .gitignore
50
+ - .travis.yml
73
51
  - Gemfile
74
- - Gemfile.lock
75
- - LICENSE.txt
76
52
  - README.md
77
53
  - Rakefile
78
54
  - VERSION
79
55
  - lib/sneaky-save.rb
80
56
  - sneaky-save.gemspec
81
- - spec/fixtures.rb
82
57
  - spec/lib/sneaky_save_spec.rb
83
58
  - spec/spec_helper.rb
84
- homepage: http://github.com/partyearth/sneaky-save
59
+ homepage: http://github.com/einzige/sneaky-save
85
60
  licenses:
86
61
  - MIT
62
+ metadata: {}
87
63
  post_install_message:
88
64
  rdoc_options: []
89
65
  require_paths:
90
66
  - lib
91
67
  required_ruby_version: !ruby/object:Gem::Requirement
92
- none: false
93
68
  requirements:
94
69
  - - ! '>='
95
70
  - !ruby/object:Gem::Version
96
71
  version: '0'
97
72
  required_rubygems_version: !ruby/object:Gem::Requirement
98
- none: false
99
73
  requirements:
100
74
  - - ! '>='
101
75
  - !ruby/object:Gem::Version
102
76
  version: '0'
103
77
  requirements: []
104
78
  rubyforge_project:
105
- rubygems_version: 1.8.25
79
+ rubygems_version: 2.1.5
106
80
  signing_key:
107
- specification_version: 3
81
+ specification_version: 4
108
82
  summary: Allows to save record without calling callbacks and validations.
109
83
  test_files: []
@@ -1,47 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (3.0.9)
5
- activesupport (= 3.0.9)
6
- builder (~> 2.1.2)
7
- i18n (~> 0.5.0)
8
- activerecord (3.0.9)
9
- activemodel (= 3.0.9)
10
- activesupport (= 3.0.9)
11
- arel (~> 2.0.10)
12
- tzinfo (~> 0.3.23)
13
- activesupport (3.0.9)
14
- arel (2.0.10)
15
- builder (2.1.2)
16
- diff-lcs (1.1.3)
17
- git (1.2.5)
18
- i18n (0.5.0)
19
- jeweler (1.6.2)
20
- bundler (~> 1.0)
21
- git (>= 1.2.5)
22
- rake
23
- rake (0.9.2)
24
- rcov (0.9.10)
25
- rspec (2.6.0)
26
- rspec-core (~> 2.6.0)
27
- rspec-expectations (~> 2.6.0)
28
- rspec-mocks (~> 2.6.0)
29
- rspec-core (2.6.4)
30
- rspec-expectations (2.6.0)
31
- diff-lcs (~> 1.1.2)
32
- rspec-mocks (2.6.0)
33
- sqlite3 (1.3.4)
34
- sqlite3-ruby (1.3.3)
35
- sqlite3 (>= 1.3.3)
36
- tzinfo (0.3.29)
37
-
38
- PLATFORMS
39
- ruby
40
-
41
- DEPENDENCIES
42
- activerecord
43
- bundler (~> 1.0.0)
44
- jeweler (~> 1.6.2)
45
- rcov
46
- rspec
47
- sqlite3-ruby
@@ -1,175 +0,0 @@
1
- Copyright (c) 2011 PartyEarth LLC
2
-
3
- GNU LESSER GENERAL PUBLIC LICENSE
4
- Version 3, 29 June 2007
5
-
6
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
7
- Everyone is permitted to copy and distribute verbatim copies
8
- of this license document, but changing it is not allowed.
9
-
10
-
11
- This version of the GNU Lesser General Public License incorporates
12
- the terms and conditions of version 3 of the GNU General Public
13
- License, supplemented by the additional permissions listed below.
14
-
15
- 0. Additional Definitions.
16
-
17
- As used herein, "this License" refers to version 3 of the GNU Lesser
18
- General Public License, and the "GNU GPL" refers to version 3 of the GNU
19
- General Public License.
20
-
21
- "The Library" refers to a covered work governed by this License,
22
- other than an Application or a Combined Work as defined below.
23
-
24
- An "Application" is any work that makes use of an interface provided
25
- by the Library, but which is not otherwise based on the Library.
26
- Defining a subclass of a class defined by the Library is deemed a mode
27
- of using an interface provided by the Library.
28
-
29
- A "Combined Work" is a work produced by combining or linking an
30
- Application with the Library. The particular version of the Library
31
- with which the Combined Work was made is also called the "Linked
32
- Version".
33
-
34
- The "Minimal Corresponding Source" for a Combined Work means the
35
- Corresponding Source for the Combined Work, excluding any source code
36
- for portions of the Combined Work that, considered in isolation, are
37
- based on the Application, and not on the Linked Version.
38
-
39
- The "Corresponding Application Code" for a Combined Work means the
40
- object code and/or source code for the Application, including any data
41
- and utility programs needed for reproducing the Combined Work from the
42
- Application, but excluding the System Libraries of the Combined Work.
43
-
44
- 1. Exception to Section 3 of the GNU GPL.
45
-
46
- You may convey a covered work under sections 3 and 4 of this License
47
- without being bound by section 3 of the GNU GPL.
48
-
49
- 2. Conveying Modified Versions.
50
-
51
- If you modify a copy of the Library, and, in your modifications, a
52
- facility refers to a function or data to be supplied by an Application
53
- that uses the facility (other than as an argument passed when the
54
- facility is invoked), then you may convey a copy of the modified
55
- version:
56
-
57
- a) under this License, provided that you make a good faith effort to
58
- ensure that, in the event an Application does not supply the
59
- function or data, the facility still operates, and performs
60
- whatever part of its purpose remains meaningful, or
61
-
62
- b) under the GNU GPL, with none of the additional permissions of
63
- this License applicable to that copy.
64
-
65
- 3. Object Code Incorporating Material from Library Header Files.
66
-
67
- The object code form of an Application may incorporate material from
68
- a header file that is part of the Library. You may convey such object
69
- code under terms of your choice, provided that, if the incorporated
70
- material is not limited to numerical parameters, data structure
71
- layouts and accessors, or small macros, inline functions and templates
72
- (ten or fewer lines in length), you do both of the following:
73
-
74
- a) Give prominent notice with each copy of the object code that the
75
- Library is used in it and that the Library and its use are
76
- covered by this License.
77
-
78
- b) Accompany the object code with a copy of the GNU GPL and this license
79
- document.
80
-
81
- 4. Combined Works.
82
-
83
- You may convey a Combined Work under terms of your choice that,
84
- taken together, effectively do not restrict modification of the
85
- portions of the Library contained in the Combined Work and reverse
86
- engineering for debugging such modifications, if you also do each of
87
- the following:
88
-
89
- a) Give prominent notice with each copy of the Combined Work that
90
- the Library is used in it and that the Library and its use are
91
- covered by this License.
92
-
93
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
94
- document.
95
-
96
- c) For a Combined Work that displays copyright notices during
97
- execution, include the copyright notice for the Library among
98
- these notices, as well as a reference directing the user to the
99
- copies of the GNU GPL and this license document.
100
-
101
- d) Do one of the following:
102
-
103
- 0) Convey the Minimal Corresponding Source under the terms of this
104
- License, and the Corresponding Application Code in a form
105
- suitable for, and under terms that permit, the user to
106
- recombine or relink the Application with a modified version of
107
- the Linked Version to produce a modified Combined Work, in the
108
- manner specified by section 6 of the GNU GPL for conveying
109
- Corresponding Source.
110
-
111
- 1) Use a suitable shared library mechanism for linking with the
112
- Library. A suitable mechanism is one that (a) uses at run time
113
- a copy of the Library already present on the user's computer
114
- system, and (b) will operate properly with a modified version
115
- of the Library that is interface-compatible with the Linked
116
- Version.
117
-
118
- e) Provide Installation Information, but only if you would otherwise
119
- be required to provide such information under section 6 of the
120
- GNU GPL, and only to the extent that such information is
121
- necessary to install and execute a modified version of the
122
- Combined Work produced by recombining or relinking the
123
- Application with a modified version of the Linked Version. (If
124
- you use option 4d0, the Installation Information must accompany
125
- the Minimal Corresponding Source and Corresponding Application
126
- Code. If you use option 4d1, you must provide the Installation
127
- Information in the manner specified by section 6 of the GNU GPL
128
- for conveying Corresponding Source.)
129
-
130
- 5. Combined Libraries.
131
-
132
- You may place library facilities that are a work based on the
133
- Library side by side in a single library together with other library
134
- facilities that are not Applications and are not covered by this
135
- License, and convey such a combined library under terms of your
136
- choice, if you do both of the following:
137
-
138
- a) Accompany the combined library with a copy of the same work based
139
- on the Library, uncombined with any other library facilities,
140
- conveyed under the terms of this License.
141
-
142
- b) Give prominent notice with the combined library that part of it
143
- is a work based on the Library, and explaining where to find the
144
- accompanying uncombined form of the same work.
145
-
146
- 6. Revised Versions of the GNU Lesser General Public License.
147
-
148
- The Free Software Foundation may publish revised and/or new versions
149
- of the GNU Lesser General Public License from time to time. Such new
150
- versions will be similar in spirit to the present version, but may
151
- differ in detail to address new problems or concerns.
152
-
153
- Each version is given a distinguishing version number. If the
154
- Library as you received it specifies that a certain numbered version
155
- of the GNU Lesser General Public License "or any later version"
156
- applies to it, you have the option of following the terms and
157
- conditions either of that published version or of any later version
158
- published by the Free Software Foundation. If the Library as you
159
- received it does not specify a version number of the GNU Lesser
160
- General Public License, you may choose any version of the GNU Lesser
161
- General Public License ever published by the Free Software Foundation.
162
-
163
- If the Library as you received it specifies that a proxy can decide
164
- whether future versions of the GNU Lesser General Public License shall
165
- apply, that proxy's public statement of acceptance of any version is
166
- permanent authorization for you to choose that version for the
167
- Library.
168
-
169
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
170
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
171
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
172
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
173
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
174
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
175
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,21 +0,0 @@
1
- class TestMigration < ActiveRecord::Migration
2
- def self.up
3
- self.down
4
- create_table(:fakes) { |t| t.string :name }
5
- end
6
-
7
- def self.down
8
- drop_table :fakes if ActiveRecord::Base.connection.tables.include? :fakes
9
- end
10
- end
11
- TestMigration.up
12
-
13
- class Fake < ActiveRecord::Base
14
- validates_presence_of :name
15
-
16
- before_save :before_save_callback
17
-
18
- def before_save_callback
19
- puts "BEFORE SAVE CALLED"
20
- end
21
- end