Commit f1b53f69a1b6cc1a228107f280bc8e03274ea2fd
1 parent
1ea6b1cb
Exists in
master
and in
11 other branches
rails4: fix migration errors with Noosfero::Plugin::ActiveRecord
Showing
20 changed files
with
33 additions
and
26 deletions
Show diff stats
config/initializers/plugins.rb
lib/noosfero/plugin.rb
lib/noosfero/plugin/active_record.rb
plugins/bsc/lib/bsc_plugin/contract.rb
| 1 | -class BscPlugin::Contract < Noosfero::Plugin::ActiveRecord | |
| 1 | +class BscPlugin::Contract < ActiveRecord::Base | |
| 2 | + | |
| 2 | 3 | validates_presence_of :bsc, :client_name |
| 3 | 4 | |
| 4 | 5 | has_many :sales, :class_name => 'BscPlugin::Sale' |
| ... | ... | @@ -81,4 +82,5 @@ class BscPlugin::Contract < Noosfero::Plugin::ActiveRecord |
| 81 | 82 | def total_price |
| 82 | 83 | sales.inject(0) {|result, sale| sale.price*sale.quantity + result} |
| 83 | 84 | end |
| 85 | + | |
| 84 | 86 | end | ... | ... |
plugins/bsc/lib/bsc_plugin/sale.rb
| 1 | -class BscPlugin::Sale < Noosfero::Plugin::ActiveRecord | |
| 1 | +class BscPlugin::Sale < ActiveRecord::Base | |
| 2 | + | |
| 2 | 3 | validates_presence_of :product, :contract |
| 3 | 4 | validates_uniqueness_of :product_id, :scope => :contract_id |
| 4 | 5 | validates_numericality_of :quantity, :only_integer => true, :greater_than_or_equal_to => 0 |
| ... | ... | @@ -16,4 +17,5 @@ class BscPlugin::Sale < Noosfero::Plugin::ActiveRecord |
| 16 | 17 | before_update do |contract| |
| 17 | 18 | contract.updated_at ||= Time.now.utc |
| 18 | 19 | end |
| 20 | + | |
| 19 | 21 | end | ... | ... |
plugins/comment_classification/lib/comment_classification_plugin/label.rb
| 1 | -class CommentClassificationPlugin::Label < Noosfero::Plugin::ActiveRecord | |
| 1 | +class CommentClassificationPlugin::Label < ActiveRecord::Base | |
| 2 | 2 | |
| 3 | 3 | belongs_to :owner, :polymorphic => true |
| 4 | 4 | |
| ... | ... | @@ -9,4 +9,5 @@ class CommentClassificationPlugin::Label < Noosfero::Plugin::ActiveRecord |
| 9 | 9 | attr_accessible :name, :enabled, :color |
| 10 | 10 | |
| 11 | 11 | COLORS = ['red', 'green', 'yellow', 'gray', 'blue'] |
| 12 | + | |
| 12 | 13 | end | ... | ... |
plugins/comment_classification/lib/comment_classification_plugin/status.rb
| 1 | -class CommentClassificationPlugin::Status < Noosfero::Plugin::ActiveRecord | |
| 1 | +class CommentClassificationPlugin::Status < ActiveRecord::Base | |
| 2 | 2 | |
| 3 | 3 | belongs_to :owner, :polymorphic => true |
| 4 | 4 | |
| ... | ... | @@ -7,4 +7,5 @@ class CommentClassificationPlugin::Status < Noosfero::Plugin::ActiveRecord |
| 7 | 7 | validates_presence_of :name |
| 8 | 8 | |
| 9 | 9 | scope :enabled, -> { where enabled: true } |
| 10 | + | |
| 10 | 11 | end | ... | ... |
plugins/custom_forms/lib/custom_forms_plugin/form.rb
plugins/custom_forms/lib/custom_forms_plugin/submission.rb
plugins/foo/lib/foo_plugin/bar.rb
plugins/oauth_client/lib/oauth_client_plugin/provider.rb
plugins/oauth_client/lib/oauth_client_plugin/user_provider.rb
plugins/shopping_cart/lib/shopping_cart_plugin/purchase_order.rb
plugins/sniffer/lib/sniffer_plugin/opportunity.rb
plugins/sniffer/lib/sniffer_plugin/profile.rb
plugins/spaminator/lib/spaminator_plugin/report.rb
| 1 | -class SpaminatorPlugin::Report < Noosfero::Plugin::ActiveRecord | |
| 1 | +class SpaminatorPlugin::Report < ActiveRecord::Base | |
| 2 | + | |
| 2 | 3 | serialize :failed, Hash |
| 3 | 4 | |
| 4 | 5 | belongs_to :environment |
| ... | ... | @@ -29,4 +30,5 @@ class SpaminatorPlugin::Report < Noosfero::Plugin::ActiveRecord |
| 29 | 30 | # TODO Implement some decent visualization |
| 30 | 31 | inspect |
| 31 | 32 | end |
| 33 | + | |
| 32 | 34 | end | ... | ... |
plugins/sub_organizations/lib/sub_organizations_plugin/approve_paternity_relation.rb
plugins/sub_organizations/lib/sub_organizations_plugin/relation.rb
plugins/tolerance_time/lib/tolerance_time_plugin/publication.rb
| 1 | -class ToleranceTimePlugin::Publication < Noosfero::Plugin::ActiveRecord | |
| 1 | +class ToleranceTimePlugin::Publication < ActiveRecord::Base | |
| 2 | + | |
| 2 | 3 | belongs_to :target, :polymorphic => true |
| 3 | 4 | validates_presence_of :target_id, :target_type |
| 4 | 5 | validates_uniqueness_of :target_id, :scope => :target_type | ... | ... |
plugins/tolerance_time/lib/tolerance_time_plugin/tolerance.rb
| 1 | -class ToleranceTimePlugin::Tolerance < Noosfero::Plugin::ActiveRecord | |
| 1 | +class ToleranceTimePlugin::Tolerance < ActiveRecord::Base | |
| 2 | + | |
| 2 | 3 | belongs_to :profile |
| 3 | 4 | validates_presence_of :profile_id |
| 4 | 5 | validates_uniqueness_of :profile_id |
| 5 | 6 | validates_numericality_of :content_tolerance, :only_integer => true, :allow_nil => true |
| 6 | 7 | validates_numericality_of :comment_tolerance, :only_integer => true, :allow_nil => true |
| 7 | 8 | attr_accessible :profile, :content_tolerance, :comment_tolerance |
| 9 | + | |
| 8 | 10 | end | ... | ... |