Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

quick renaming

  • Loading branch information...
commit bb27e9ce690f96201612eb0b509de8662375ffc5 1 parent 6a4a894
@ethn ethn authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/cardlib/{settings.rb → rules.rb}
View
6 lib/cardlib/settings.rb → lib/cardlib/rules.rb
@@ -1,4 +1,4 @@
-module Cardlib::Settings
+module Cardlib::Rules
RuleSQL = %{
select rules.id as rule_id, settings.id as setting_id, sets.id as set_id, sets.left_id as anchor_id, sets.right_id as set_tag_id
from cards rules join cards sets on rules.left_id = sets.id join cards settings on rules.right_id = settings.id
@@ -59,7 +59,7 @@ module ClassMethods
def rule_cache
@@rule_cache ||= Card.cache.read('RULES') || begin
hash = {}
- ActiveRecord::Base.connection.select_all( Cardlib::Settings::RuleSQL ).each do |row|
+ ActiveRecord::Base.connection.select_all( Cardlib::Rules::RuleSQL ).each do |row|
setting_code = Wagn::Codename[ row['setting_id'].to_i ] or next
anchor_id = row['anchor_id']
set_class_id = anchor_id.nil? ? row['set_id'] : row['set_tag_id']
@@ -85,7 +85,7 @@ def set_rule_cache hash
def read_rule_cache
@@read_rule_cache ||= Card.cache.read('READRULES') || begin
hash = {}
- ActiveRecord::Base.connection.select_all( Cardlib::Settings::ReadRuleSQL ).each do |row|
+ ActiveRecord::Base.connection.select_all( Cardlib::Rules::ReadRuleSQL ).each do |row|
party_id, read_rule_id = row['party_id'].to_i, row['read_rule_id'].to_i
hash[party_id] ||= []
hash[party_id] << read_rule_id
Please sign in to comment.
Something went wrong with that request. Please try again.